Achieving equal column heights in Bootstrap 4 using embeds

I'm currently developing an interactive web interface, and I'm facing a challenge with a row in bootstrap that consists of two columns. One column contains an "embed-responsive-16by9" element, while the other column has a ul whose height is unknown. My goal is to make the ul column match the height of the embed column, overflowing if it's larger but not shrinking if it's smaller.

I've experimented with ".row-eq-height", setting max-height, and other methods, but nothing seems to have solved the issue.

<div className="container-fluid">
  <div className="row h-40 row-eq-height">
    <div className="col">
      <div className="rounded resize shadow-sm">
        <div className="embed-responsive embed-responsive-16by9">
          <iframe
              className="embed-responsive-item"
              src="https://www.youtube.com/embed/RHXsHZMBIcQ"
              title="Video Player"
          />
        </div>
        <div className="pl-2 pt-2">
          <input className="mr-1" type="checkbox" />
          <label>Autoplay?</label>
        </div>
      </div>
    </div>
    <div className="col">
      <ul className="list-group container float-left rounded p-0 mr-auto eq-col min-vw-30 max-vw-80 resize shadow-sm">
        <nav className="navbar navbar-light navbar-right bg-light m-2 p-1">
          <h1 className="navbar-brand">Watched Teams</h1>
          <div className="form-inline my-2 my-lg-0">
            <input
              className="form-control mr-sm-2"
              type="search"
              placeholder="Search"
            />
            <button
              className="btn btn-outline-success my-2 my-sm-0"
              type="submit"
            >
              Search
            </button>
          </div>
        </nav>
        {this.state.teams.map(team => (
          <Team key={team.teamNum} team={team} />
        ))}
      </ul>
    </div>
  </div>
</div>

For your information, I am using React for this project, so the code is split into multiple components. However, I have combined everything here for clarification purposes.

SOLUTION: I found that using h-100 and flex-grow-1 did the trick. Although I had tried both before, applying them directly to the ul element was the missing piece.

<ul className="h-100 list-group container float-left rounded p-0 mr-auto eq-col min-vw-30 max-vw-80 shadow-sm flex-grow-1">

Answer №1

The solution involved incorporating h-100 and flex-grow-1...Although I had attempted using both previously, it seems that applying them directly to the ul element made all the difference.

<ul style="h-100 list-group container float-left rounded p-0 mr-auto eq-col min-vw-30 max-vw-80 shadow-sm flex-grow-1">

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

Combining CSS, jQuery, and HTML into a single .html file would allow for seamless integration

I've been searching extensively, but I haven't been able to locate exactly what I need. My goal is to merge my jQuery and CSS into a single .html file, but I'm struggling to get the jQuery functionality to work. Although I have experience wi ...

Responsive full-screen background image display

Why is the background image not appearing as a full image on large screens but fitting fine on small screens? <!DOCTYPE html> <html dir="ltr"> <head> <meta charset="utf-8" dir="ltr" /> <title ...

How to arrange messages in a chat box using Bootstrap 4 without the need for JavaScript

Is there a way to adjust my chat box so that messages appear at the bottom, like in any chat app? I am currently using Django and Bootstrap 4, here is the code I have: <div class="list-group flex-column-reverse " id="Chatt ...

Decrease the amount of empty space when adjusting the window size

Struggling to make a section of my website responsive and encountering an issue that's proving difficult to solve. The current setup involves 3 rectangular inline-block divs per "row" with a margin-right of 100px in a wrapper, all dynamically added. ...

I am facing an issue where my node.js web application, which utilizes bootstrap, functions perfectly when running locally but encounters difficulties when

I'm currently working on creating a real estate web application. I found a great html/css theme on envato that looks amazing when viewed locally, but not so much when I try to run it on my express server hosted on my machine. Upon removing "var boot ...

Aligning multiple items to the right using Flexbox

While it's common knowledge how to align one item to the right in flexbox, what about aligning multiple items, like the last two elements, to the right and the rest to the left? Take a look at this example where I want elements with the class .r to be ...

Strange gray gradient background suddenly showing up on mobile devices

Encountering an issue with a login form displayed on a sliding modal. The design looks correct on desktop and even in responsive mode with dev tools, but when accessed through mobile Chrome or Safari on an iPhone, an unusual gray rounded box or shadow appe ...

Margin challenge in CSS

Just starting out with CSS, so please be patient with me. I'm currently working on customizing a form and everything is looking good, except for the confirmation label which is located in a div. I've managed to create space between other elements ...

How can I resize and horizontally align an image using html/css?

Is it possible to resize, crop and center an image using only HTML/CSS? (Using the img tag or CSS sprite) For instance, if I have a 500x500 pixel image, I would like to resize it to a 250x250 pixel image To make the actual visible image 100x100 pixe ...

Is there a CSS equivalent of column-gap for rows?

After following this guide, I attempted to recreate the photo grid with some spacing between the images. Changing the column-gap property to 3px did add horizontal space, but is there a way to include vertical gaps as well? Any suggestions or solutions wou ...

Using bootstrap to offset columns fails to function properly in the second row

I'm currently developing a weather application and I'm facing a challenge with centering columns using Bootstrap's grid system. I have two rows that display the current local weather conditions. In order to center these columns on the page, ...

The image spills out of its confines

Looking to create a dialogue box that fills the entire width and height of the screen? Want to divide its content into two sections - an image and a footer area with 2 rows of height? Struggling to contain the image within its designated space without over ...

The functionality to Toggle submenus within a navigation menu using jQuery is not performing as anticipated

I implemented a horizontal menu using CSS, HTML, and jQuery. Clicking on a menu item displays a sub-menu. The issue I'm facing is that when one submenu is open and I click on another menu item, the new submenu opens but doesn't hide the previous ...

Combining rows and columns in Flexbox design

https://i.stack.imgur.com/tDLii.png I'm able to easily create this layout using the float property, but I'm having some difficulties achieving the same with flexbox. CSS: .a { background: red; float: left; width: 30%; ...

How can a borderless text field be created using Material UI?

Today, I delved into using Material UI for my React project. My goal is to create a registration form similar to this one. Essentially, I want 5 input text fields without any borders and with a simple background color effect when active. However, I'm ...

Issues arise when attempting to smoothly scroll to an anchor point in a webpage

While working on my website, I have encountered a challenge. The issue arises when dealing with multiple div items. Upon scrolling slightly, the entire page focuses on the div with a height of 100vh, which works perfectly fine. However, my attempts to ...

How to display text on a new line using HTML and CSS?

How can I properly display formatted text in HTML with a text string from my database? The text should be contained within a <div class="col-xs-12"> and nested inside the div, there should be a <pre> tag. When the text size exceeds the width o ...

Ways to align text and horizontal rule perfectly within a div container?

I need to add some text to my <div> container and make sure it is centered. .hr { background: green; height: 50px; margin: 65px 0; width: 3000px; } <div class="hr"></div> This is an illustration of my project: https://i.sstatic.n ...

Addressing see-through box styling in CSS

When working on a website using HTML and CSS, I encountered an issue with a transparent box. All elements within this box are also transparent, but I want them to be solid without any opacity. How can I resolve this? .parent { display: inline-block; ...

When the button is clicked, the ng-click event will trigger the addClass function, but only on the second click

My bootstrap alert has this structure: <div id="errorAlert" class="alert col-md-6 col-md-offset-3 fadeAlert" ng-if="itemExistsAlert"> <button type="button" class="close" data-dismiss="alert">&times;</button> <p>{{alertM ...