The flex column refuses to expand and fill the available space within the column

Just starting to work with flexbox and I'm puzzled about why the two divs on the right aren't taking up all the height space.

My goal is to have a large column on the left, while the right column is split into two rows.

CSS:

.card {
  display: -webkit-flex;
  display: flex;
  margin:8% auto auto auto;
  width:450px;
  height: 150px;
  min-height: 100px;
  color: black;
}

.left-tile {
  flex: 3;
  background: #02A0E5; 
}

right-tile {
  flex: 2 1 50%;
  background: #FD6800;
  display: -webkit-flex;
  display: flex;
  flex-direction: column;
}

.up-right-tile { 
 background: #D03324;
 flex: 2;
}

.low-right-tile {
  background: #FD6800;
  flex: 2;
}

HTML

.container
  .card
    .left-tile
      .card-content
        .quote-content
          ....
    .right-tile
      .up-right-tile
        .twitter-button
          ....
      .low-right-tile
        .new-quote
          ....

You can view the actual code pen code here.

Answer №1

The key element missing from your codepen is the declaration of the card class as a flex container.

To achieve this, you should define it as follows:

.card {
  position:relative;
  margin:8% auto auto auto;
  width:450px;
  height: 100px;
  display: flex;
  display: -webkit-flex;
  background-color:#fff;
} 

Just an update:

Your concept seems correct. The only error is that right-tile is missing the . before it. Once you add this, your code should work perfectly. Cheers!

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Why isn't the z-index functioning properly in Vue.js styling?

I am currently developing a simple component that displays four steps, indicating the current step and allowing users to navigate through them. I want to create a design where these numbers are enclosed within circles that are evenly distributed in a line ...

Adaptable Bootstrap Button that Adjusts to Different Screen Sizes

I want this button to adjust its size according to the screen dimensions. The current code keeps the button fixed in place. See below for the code snippet. <button type="button" [className]="'btn btn-block m-0'" kendoButton ...

Choosing a specific category to display in a list format with a load more button for easier navigation

Things were supposed to be straightforward, but unexpected behaviors are popping up all over the place! I have a structured list like this XHTML <ul class = "query-list"> <li class="query"> something </li> <li class="query" ...

Tips for eliminating the additional spacing that might occur between the logo and the content

Is there a way to ensure the white content is right up against the logo without any blank line in between? I've already set the margin-top to 0, but there's still space appearing. <body background="$request.getContextPath()/images/background. ...

Adding a three-dimensional perspective to an HTML5 canvas without utilizing CSS3 or WebGL

Here is a canvas I am working with: http://jsbin.com/soserubafe Here is the JavaScript code associated with it: var canvas=document.getElementById("canvas"); var ctx=canvas.getContext("2d"); var w = canvas.width; var h = canvas.height; var cw=canvas. ...

How do I eliminate excess space following the resizing of the Material UI Drawer component?

I adjusted the size of my MUI drawer to a specific width and now I am facing an issue where there is extra space left after resizing. This results in a margin-like space between the drawer and the Lorem Ipsum text content. My goal is to eliminate this rema ...

Struggling with Implementing a Hollow Button in Bootstrap 3

Could you please review This Demo and provide guidance on how to remove the grey background color when clicking on the button? I attempted the following: .btn-hallow:hover{ background: none; color: aliceblue; } .btn-hallow.active:focus{ backg ...

quirky behavior of form inputs on mobile devices in a responsive webpage

I encountered a strange issue while developing a responsive webpage with form input. Whenever I tapped on an input field on my mobile phone to enter something, the screen would zoom in and cut off the text box on the left side, making it impossible to see ...

The loading bar function seems to be malfunctioning when paired with the navbar element <nav> in an HTML document

Can you assist me with a coding issue I am facing? I have implemented a loadingbar on my webpage similar to YouTube, and it works perfectly on the page itself. However, when I try to integrate it with a navigation bar, it stops working. Below is the code ...

issues with jquery functionality on mobile devices

I'm currently working on a website where I've implemented a jQuery script to dynamically load specific parts of an HTML page with an ID of 'guts' into the main content area. The goal was to keep the menu consistent while only changing t ...

The unequal division of space between two flexed child divs is caused by varying image sizes

In my parent container, I have set the display property to flex. Inside, there are two divs with both having flex:1 set. However, the first child div contains an image and takes up twice as much space as the second div. If the screen is 1000px in height, ...

CSS - reduce the size of an element rather than the entire page

Looking to create a page with 2 divs where the first div automatically shrinks and adds scrollbars when the browser window height is decreased, while the second div maintains its height. Wondering if this can be achieved using only CSS. <div class="s ...

Using HTML and CSS to create a Mondrian-inspired design with

ASDFGH. Hi there, currently learning HTML and attempting to create a Mondrian-style image. However, I seem to be only able to display six boxes, with the last three (boxes 7, 8, and 9) not showing up. Here is my code. Could someone please help me figure ou ...

Is there a way to change the entire background color of my popover?

Hi there! My issue is that the arrow in my popover isn't changing color and is still showing up as white. Here is the current code: http://jsfiddle.net/GZSH6/19/ Here is the CSS code: .popover { background: #BE7979; color: white; borde ...

Adjusting the size of a Video/Image Slider to perfectly fit the screen dimensions (both width and height

I have been using a slider code to display my images and videos. The code can be found here: Code:https://codepen.io/1wdtv/pen/jbjZeb The issue I am facing is that the slider is only responsive in terms of width. This means that when resizing the browser ...

Is there a way to modify the way a screen-reading tool pronounces a specific word in a sentence without causing interruptions in the middle of the sentence?

Imagine I have the following sentence written in HTML: <p>Please input your licence number</p> An issue arises when a screen-reader pronounces the word 'licence' as "liss-ens" instead of "lice-ens." To resolve this, I aim to provide ...

Changing Ionic Column Widths Based on Content Length

In my dynamic ionic 2 grid system, I am facing a layout issue. <div> <ion-row> <ion-col > ; <ion-card-header class="card-header"> {{hunt.title}} </ion-card-header> </ion-col> <ion-col *ngIf="!hunt. ...

None of the angular directives are functioning properly in this code. The function attached to the submit button is not executing as expected

I've experimented with various Angular directives in this code, but none seem to be functioning properly. I'm wondering if a library file is missing or if there's some issue within the code itself, potentially related to the jQuery file. The ...

Is your CSS failing to display images properly?

I recently launched my website, www.alphenweer.nl, and everything seems to be working fine except for the images in the template. Despite being on the correct URL, the images fail to load when the website is accessed. You can test it out here. Can someone ...

Updating a conditional statement in jQuery

Understanding jQuery has always been a challenge for me. I find myself spending hours reading documentation every time I try to implement it, only to achieve very little progress. Here's the code I'm currently working on with live-editing availab ...