Achieving uniform card heights with .d-flex and .flex-fill styling

After following the solution provided here: How to make Bootstrap 4 cards the same height in card-columns?

I successfully achieved uniform height and width for some cards nested within another card.

However, in a different scenario, the heights of the cards are not consistent.

What am I doing incorrectly?

<div class="row row-cols-1 row-cols-md-2">
<div class="d-flex col mb-3">
    <doors class="flex-fill">
        <div class="card">
            <div class="card-header"> AAA </div>
            <div class="card-body">
                <ul class="list-group">
                    <door>
                        <li class="list-group-item">A1</li>
                    </door>
                    <door>
                        <li class="list-group-item">A2</li>
                    </door>
                </ul>
            </div>
        </div>
    </doors>
</div>
<div class="d-flex col mb-3">
    <commands class="flex-fill">
        <div class="card">
            <div class="card-header"> BBB </div>
            <div  class="card-body">
                <ul class="list-group">
                    <command>
                        <li class="list-group-item">B1</li>
                    </command>
                    <command>
                        <li class="list-group-item">B2</li>
                    </command>
                    <command>
                        <li class="list-group-item">B3</li>
                    </command>
                </ul>
            </div>
        </div>
    </commands>
</div>

This is the modified HTML snippet from my Angular application that has been cleaned up for better readability.

I have attempted several adjustments such as moving .flex-fill to the card and using .d-flex on the immediate parent of the card, but the issue persists.

You can view the problem live at : https://codepen.io/Ell0ne/pen/QWKGNRd

Answer №1

To ensure that the cards fill the height of the columns, the h-100 class can be used...

<div class="row row-cols-1 row-cols-md-2">
    <div class="d-flex col mb-3">
        <doors class="flex-fill">
            <div class="card bg-inf h-100">
                <div class="card-header"> AAA </div>
                <div class="card-body">
                    <ul class="list-group">
                        <door>
                            <li class="list-group-item">A1</li>
                        </door>
                        <door>
                            <li class="list-group-item">A2</li>
                        </door>
                    </ul>
                </div>
            </div>
        </doors>
    </div>
    <div class="d-flex col mb-3">
        <commands class="flex-fill">
            <div class="card h-100">
                <div class="card-header"> BBB </div>
                <div class="card-body">
                    <ul class="list-group">
                        <command>
                            <li class="list-group-item">B1</li>
                        </command>
                        <command>
                            <li class="list-group-item">B2</li>
                        </command>
                        <command>
                            <li class="list-group-item">B3</li>
                        </command>
                    </ul>
                </div>
            </div>
        </commands>
    </div>
</div>

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

Creating your own custom selection is an exciting opportunity to personalize your choices

I am interested in creating my own customized select element. Currently, the design of my select element is as follows: https://i.sstatic.net/eQNXb.png JS Fiddle This is the code for how it is currently implemented: <p>Title</p> <form&g ...

Changing the stylesheet on a single-page application

Our angular-built single page app features a drag-and-drop interface for code snippets, each with its own unique styles separate from the main Bootstrap-themed admin panel. However, due to the differences in styling, navigating to the drag-and-drop sectio ...

Is there a way to apply border-radius to the header of a table in Bootstrap 5?

My use of Bootstrap 5 for styling a table has encountered an issue. Even with the border-radius set on the table-dark class, the thead element's border does not change. I am looking for a way to address this problem. Any suggestions? .table-dark { ...

What is the best way to align a value within CardActions in Material UI?

I'm currently facing an issue with my website design. Here's a snapshot of how it looks: https://i.sstatic.net/UuBJJ.png Additionally, here is the code snippet related to the problem: <CardActions> <Typography style={{ fon ...

How can you adjust a background image to perfectly fit across various screen sizes?

I am just starting out with web development and I am building a website using HTML/CSS. The background of my site looks good on my macbook pro, but when I try to view it on a larger screen, the background repeats and the content stays in the top left corne ...

Reorganizing Bootstrap 5 columns as the screen size changes

I need to change the display order of columns in bootstrap Currently I have two columns side by side in one row like this: Col A - Col B (on all screens except mobile devices) However, when the screen size is reduced or viewed on a mobile device, I want ...

Implementing text sliding effect upon hovering over an image using CSS

Is there a way to make text appear when hovering over an image, sliding in from the top and covering only 50% of the image height? Here's the code I have so far: <img style="background-color:#3b283e; float:left;" src="images/f1.jpg" /> <div ...

Looking to conceal an <hr> element using jQuery's slideToggle function and then reveal it when clicked once more

I recently embarked on my journey to learn jQuery. I encountered a challenge with a simple button that triggers the slideToggle function to show/hide a div. Directly above this toggled div, there is an break line which I want to hide when the button is in ...

Is There a Way to Verify if JqxGrid Contains Any Errors?

Within the code below, I have successfully displayed highlighted borders when there are validation failures. Is it possible to determine any validation errors in a grid when a button is clicked? By clicking the button at the bottom, I would like to be able ...

Dynamic backdrop featuring engaging content

I am currently working on a WordPress website that features a dynamic background. While I have successfully implemented movement to the background, the content on the site remains static and unaffected by scrolling. The background does not move alongside t ...

What is causing this mysterious gap to appear between these two elements?

Can someone help me identify the issue between these two p elements? I checked the box model and there doesn't seem to be any margin set. Here is the fiddle and code for reference - https://jsfiddle.net/f3m2apgy/ <body> <style> #conta ...

Using CSS backdrop-filter to create a unique blurred border effect for your web elements

In my quest for achieving unique visual effects, I have been experimenting with the backdrop-filter and element borders. While it is easy to create an element that blurs its background, I am facing challenges in making the filter affect only the border are ...

What is the best approach for implementing a CSS reset across multiple websites with different content?

As I work on a page that will be displayed across numerous websites beyond my control, shown within a jQuery UI dialog window using $.load(), the content is vulnerable to the CSS directives set by each individual site. To prevent conflicts, I have made sur ...

Node-modules CSS

In my React application, I am utilizing CSS modules. By configuring modules:true in my webpack.config.js, I can successfully apply styles from files within my src folder. However, when importing components from node-modules, the corresponding CSS is not be ...

Assistance Needed with XPATH and CSS for Selenium Automation

Can anyone assist me in finding the appropriate XPATH/CSS locator to extract text from the structure below? <div class="page-header song-wrap"> <div class="art solo-art"> <div class="meta-info"> <h1 class="page-title"> Zehnaseeb I ...

Guide to modifying the attributes exclusively of the external borders in Bootstrap tables

Is there a way to customize only the outer border of a bootstrap 4 table by changing properties such as border-color, border-style, and border-radius? I attempted to do so, but it seems that the properties are being overridden. Here is my code: <!DOCT ...

Creating Vertical Text and Div Blocks using CSS

Trying to set up different color section blocks with vertical text on my website's dashboard page. Similar to this example in JSfiddle: http://jsfiddle.net/afpn2y19/4/ <div id="outer"> <div id="inner"> //Feeling lost - ho ...

Ensure that the table is padded while keeping the cells collapsed

I am currently working on creating a table with borders between each row. However, I am facing an issue where the row borders are touching the outer border of the table. Despite my efforts, I have been unable to find a solution to this problem. I feel like ...

"Combining Three.js for dynamic rendering with Bootstrap grids for responsive

Experimenting with three.js and bootstrap, I encountered an issue where the cube appears flattened when using bootstrap grids: https://i.sstatic.net/M2G4D.jpg Oddly, resizing the window fixes the problem: https://i.sstatic.net/E09BL.jpg Attempts to rem ...

Pictures do not adhere to the maximum width set on their parent elements

When the max-width CSS style is set on the body tag and an image within the body surpasses this maximum width, the image does not adhere to the set limit. Instead of resizing, it simply overflows. Why does this happen? So, what is the solution to this pro ...