Why doesn't the row-eq-height class apply to column heights?

For my WordPress theme coding, I rely on bootstrap 4

Struggling to understand why the row-eq-height class isn't functioning as expected in bootstrap columns.

https://i.sstatic.net/R33K4.jpg

Here are my codes:

<?php get_header(); ?>

<div class="container mt-4 "> 
     <strong><?php echo single_cat_title(); ?> </strong> <hr>   
    <div class="row row-eq-height "> 
        <?php while ( have_posts() ) : the_post();  ?>
        <div class="col-md-4">
         <div class="card mb-4 border-dark">
            <img class="card-img-top" src="//placeimg.com/290/180/any" alt="Card image cap">

            <div class="card-body">
               <h5 class="card-title"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h5>
               <p class="card-text"><?php the_excerpt(''); ?></p>
               <a href="<?php the_permalink(); ?>" class="btn btn-dark btn-sm">More..</a>
            </div>
         </div>
      </div>

    <?php endwhile; ?>


    </div>
</div>

<?php get_footer(); ?>

I've even tried adding the row-eq-height class manually in CSS, but still no luck.

Where am I going wrong?

Edit: Here is a snippet of generated code that might provide some clues:

<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<div class="container">
  <div class="row "> 
    <div class="col-md-4">
             <div class="card mb-4 border-dark">
                <img class="card-img-top" src="//placeimg.com/290/180/any" alt="Card image cap">
               
                <div class="card-body">
                   <h5 class="card-title"><a href="http://localhost/alfa/selam/" title="Selam">Selam</a></h5>
                   <p class="card-text"></p><p>dsff nmfgmnf</p>
    <p></p>
                   <a href="http://localhost/alfa/selam/" class="btn btn-dark btn-sm">More..</a>
                </div>
             </div>
          </div>
    
    <div class="col-md-4">
             <div class="card mb-4 border-dark">
                <img class="card-img-top" src="//placeimg.com/290/180/any" alt="Card image cap">
               
                <div class="card-body">
                   <h5 class="card-title"><a href="http://localhost/alfa/merhaba-dunya/" title="Merhaba dünya!">Merhaba dünya!</a></h5>
                   <p class="card-text"></p><p>The standard Lorem Ipsum passage, used since the 1500s “Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse […]</p>
    <p></p>
                   <a href="http://localhost/alfa/merhaba-dunya/" class="btn btn-dark btn-sm">More..</a>
                </div>
             </div>
          </div>
    
    
    </div></div>

Answer №1

All the columns are equal in height, but their content varies and does not occupy the full height.

To ensure each card element fills the entire height, you can include h-100 class:

<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<div class="container">
  <div class="row ">
    <div class="col-md-4">
      <div class="card h-100 border-dark">
        <img class="card-img-top" src="//placeimg.com/290/180/any" alt="Card image cap">

        <div class="card-body">
          <h5 class="card-title"><a href="http://localhost/alfa/selam/" title="Selam">Selam</a></h5>
          <p class="card-text"></p>
          <p>dsff nmfgmnf</p>
          <p></p>
          <a href="http://localhost/alfa/selam/" class="btn btn-dark btn-sm">More..</a>
        </div>
      </div>
    </div>

    <div class="col-md-4">
      <div class="card h-100  border-dark">
        <img class="card-img-top" src="//placeimg.com/290/180/any" alt="Card image cap">

        <div class="card-body">
          <h5 class="card-title"><a href="http://localhost/alfa/merhaba-dunya/" title="Merhaba dünya!">Merhaba dünya!</a></h5>
          <p class="card-text"></p>
          <p>The standard Lorem Ipsum passage, used since the 1500s “Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
            nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse […]</p>
          <p></p>
          <a href="http://localhost/alfa/merhaba-dunya/" class="btn btn-dark btn-sm">More..</a>
        </div>
      </div>
    </div>



  </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

Having trouble aligning photos in the grid

I am facing an issue aligning my menu and image grid. The grid is inline-block but the first item stays stuck in the upper right-hand corner no matter what I do, without affecting the navigation menu placement. Additionally, when testing locally, everythin ...

How to adjust the size of a div based on its child content, including margins

I have encountered an issue with animating the height of a configurable content div, which typically contains paragraphs of text. Shown below is my animation (slowly paced), starting from a height of 0 and expanding to its calculated height based on its c ...

A versatile CSS solution for fixed background images that stretch to fit any screen height across multiple browsers

Similar Question: Stretch and Scale CSS Background I am interested in finding a method to create a background with specific criteria: - remain fixed in place - adjust proportionally based on the window's height - work across all browser types or ...

Using CSS to create centered blocks

I have a list of blocks that I want to center without any margins, like the example below but margin-free. ul{ margin:0px; padding:0px } .colors{ padding-left: 50px; padding-right: 50px; } .colors li{ display: inline-block; list-st ...

Tips for effectively personalizing the dropdown menu made with ul-li elements

https://i.sstatic.net/7kkqL.png https://i.sstatic.net/dCwkI.png After creating a drop-down menu using ul and li tags, I realized that when the menu is opened, it shifts the blocks below on the screen. To prevent this from happening, I adjusted my CSS as ...

What is the best way to align an avatar within a cardHeader component in the center?

Recently, I've been working on a frontend project using Material UI. In my design, I have cards that display data, and I wanted to include an avatar in the center of each card. Despite using a card header to insert the avatar, I struggled to align it ...

Utilizing external CSS to style an SVG file within an HTML document

Hello there, I have a collection of SVG files that I need to dynamically modify the fill color of, preferably using CSS. Here is the structure: <div> <svg width="100%" height="100%" viewbox="0 0 64 64" preserveAspectRatio="xMinYMin m ...

Why does LESS keep prompting me with missing elements?

I am currently working on my first project using Less and have been following a tutorial closely. However, when I try to compile with lessc, I encounter the following error: ParseError: Unrecognised input. Possibly missing something in C:\Path\t ...

Unable to utilize CSS3 features within visual studio 2010

While working on website design using Visual Studio 2010 service pack 1, I encountered an issue where I cannot utilize CSS3. Despite attempting to incorporate border properties for the front page, I kept receiving an error message stating that it is ' ...

What is the best way to incorporate a Django variable as the width parameter in a style tag within HTML?

I'm attempting to utilize a Django variable as the percentage width value within a style tag in HTML, but it's not functioning correctly. Strangely, I've discovered that using curly braces {} within style tags is prohibited—this contradict ...

"Vanishing Act: Bootstrap menu vanishes after a click

Having difficulties with the menu on my website wrapster.sebastianbialek.pl. Whenever I resize the browser to mobile version and click on the collapse button, the menu shows up briefly and then disappears. Any assistance in resolving this issue would be gr ...

Challenges faced when using Selenium with Telerik RadMenu

For the past two days, I've been struggling to find an effective method for writing integration tests for my ASP.NET website using Selenium. The website features a Telerik RadMenu with a hierarchical structure like this: Root Menu - Menu 1 - Sub M ...

What steps should be followed in order to replicate the border design shown in the

Checkboxes Border Challenge I am looking to connect the borders between my checkboxes. I attempted to use pseudo-borders, but encountered issues with setting the height for responsiveness across various screens. If anyone has suggestions on how to tackl ...

The importance of color value is underscored

Is there a way to remove the surrounding color from the value in Visual Studio Code and only display the little square on the left side? [.nav-link-wrapper a { color: #ec0b0b } ] https://i.stack.imgur.com/5uA9k.png ...

Slideshow plugin glitch on Safari and Opera caused by jQuery implementation

My current project involves utilizing a fantastic plugin called Sequence.js for creating animations and transitions with CSS3 based on jQuery. I have set up a simple responsive fadeIn-fadeOut slideshow using this plugin. While everything works smoothly an ...

Ensuring the HTML remains at its original scale while scaling a div using CSS

My code consists of HTML and CSS that look like this: <div class="box" style="transform: scale(2);"> <div class="text">This is my text.</div> </div> I'm trying to figure out how to prevent the text inside the box from sca ...

The CSS styling for the div element is not functioning properly despite my numerous attempts

I've been working on a website and I'm trying to ensure that all the main content fits within a 1068px wide container. I created a 'wrapper' div to hold the code, but styling doesn't seem to be applied correctly. I need a solution ...

Tips for creating a bookmarkable link in JavaScript

I've encountered an issue with distinguishing and bookmarking several links on a page. For example, if I have a contact.php page with multiple jQuery click events linked to different sections such as www.mywebsite.com/contact.php#accountant, www.myweb ...

What is the best way to make a fixed div appear when a user scrolls down the page, similar to Facebook

As I was scrolling down on Facebook, I noticed that the ads divs stay fixed when they reach the bottom. Has anyone figured out how to achieve this effect? I believe it can be done using a combination of JavaScript and CSS. Does anyone have the code for im ...

How to Align Two HTML Forms Using CSS

I've been experimenting with various methods, but I'm still unable to achieve the desired outcome. Currently, my setup looks like this: https://i.sstatic.net/fUXKr.png However, what I really want is something more like this: https://i.sstatic ...