Creating 2 rows with dual horizontal columns in Bootstrap that maintain equal height and responsiveness

I need to design a responsive navigation and search bar container row with a 3 column-wide logo on the left (comprised of two horizontal columns) and a 9 column-wide navigation and search bar on the right (also made of two horizontal columns - navigation on top and search bar on bottom). It's crucial that all these columns have the same height on various devices. Please refer to the image for the current and desired outcome:

I've attempted to use w-100 and set the height to 100%, along with trying different Bootstrap techniques to ensure equal heights for all columns, but I'm struggling to achieve the desired result. Manually setting the column height won't be effective across multiple devices. As I'm not a Bootstrap expert, there may be a fundamental flaw in my approach to this design.

<div class="row">

//container for the two columns on the left, containing both parts of the logo

  <div class="first-container col-lg-3">
    <div class="row d-flex flex-column">
      <div class="col-lg-12 w-100">
        <img src="public/img/....png" alt="logo-desktop" class="w-100" />
     </div>
      <div class="col-lg-12 w-100">
        <img src="public/img/....png" alt="logo-desktop" class="w-100" />
     </div>
    </div>
  </div>

//container for the two columns on the right, containing the navigation and search bar

  <div class="second-container col-lg-9">
    <div class="row d-flex flex-column ">
      <div class="col-lg-12">
        <nav class="navbar navbar-inverse navbar-toggleable-md">...
          //navigation bar
        </nav>
     </div>
      <div class="col-lg-12">
        //search bar
     </div>
   </div>
  </div>
</div>

The expected outcome should match the image provided. Thank you for any assistance!

Answer №1

Let's streamline the structure and get rid of the unnecessary nesting.

<div class="row">
    <div class="col-3">
        <img src="//placehold.it/160x40" alt="logo-desktop">
    </div>
    <div class="col-9">
        <nav class="navbar navbar-dark py-0 bg-dark navbar-toggleable-md">
            <a href="/" class="navbar-brand">Navbar</a>
            <div class="navbar-collapse collapse" id="navbar5">
                <ul class="navbar-nav">
                    <li class="nav-item active">
                        <a class="nav-link" href="#">Link <span class="sr-only">Home</span></a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#">Link</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#">Link</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#">Link</a>
                    </li>
                </ul>
            </div>
        </nav>
    </div>
    <div class="col-3">
        <img src="//placehold.it/160x40/222" alt="logo-desktop">
    </div>
    <div class="col-9">
        <input class="form-control" placeholder="search bar">
    </div>
</div>

https://www.codeply.com/go/C89nFud7db

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

What is causing the issue with the minlength and maxlength validations not functioning correctly?

I am currently working with AngularJS and HTML to write code. I am facing an issue where the minlength and maxlength validations are not functioning properly in my code. Below is a snippet of my HTML code: <input type="text" id="healthcomplaint" ng-m ...

Centering text using CSS Bootstrap

Hey everyone, I've been attempting to center my text using Bootstrap, but for some reason it's not working. Can someone help me figure out what's going on? <footer class="row p-1 mt-3 bg-primary text-white"> <p class= ...

JavaScript fails to enforce character limits on form text fields

After multiple attempts to limit the number of characters in an input field using JavaScript, I am still faced with the issue. function yeahbaby() { document.getElementByName("surname").maxLength = "40"; } This function is called upon loading the form as ...

Attempting to make a button display a hidden block element within a specific set, while also ensuring that all other elements are closed

I am facing an issue with my three field sets that are displayed one at a time after clicking a continue button on the previous set. Moreover, I have added an edit button to the parent of the recently closed fieldset so that users can reopen it. However, w ...

What makes a solid HTML object model in Java?

Currently on the search for a Java-based HTML object model that has the capability to parse HTML (though not necessarily required) and encompass all HTML elements, as well as CSS, within an elegant object model. Hoping to find a Java equivalent of Groovy& ...

Guide to updating an image with arrow keys in javascript

Looking for help with a javascript gallery. I need to change the image using arrow keys after opening the modal popup. Left arrow key should move the image to the left and right arrow key to the right. Any assistance would be greatly appreciated as I' ...

Is it safe to store data in an HTML5 iOS app using localStorage, WebSQL, or IndexedDB?

Currently, I am in the process of developing an HTML5 application intended for release on the iOS app store. My plan is to either utilize PhoneGap or wrap it within a UIWebView control. One aspect that has me a bit puzzled is deciding how to best handle d ...

``Is there a way to redirect users when they click outside the modal-content in Bootstrap

I have a modal on my website that currently redirects to the homepage when the close button is clicked. However, I also want it to redirect to the homepage when clicking outside of the bootstrap modal, specifically targeting the ".modal-content" class. I ...

Maintain uniform height of divs while adjusting image size without altering padding

My challenge lies in creating a layout of images in columns with consistent padding between them. The ultimate goal is to ensure that the images align at the bottom, regardless of screen size variations as depicted in this image: The problem arises when t ...

Make sure to employ Bootstrap's justify-content-between and stack-to-horizontal col correctly

I am currently working on a responsive form that contains 1 label, 1 input field, and 5 buttons. Both the buttons and the input field are located under col-8. The positioning I aim for the buttons is as follows: They should start below and align with ...

The scrollbar extended to match the full height of the screen

I am looking to implement a scroll bar for the first div if its content exceeds the screen size, while I want the second div to stretch along the height of the screen. How can I enable a scrollbar for the first div when overflow: scroll; does not work? ...

To collapse a div in an HTML Angular environment, the button must be clicked twice

A series of divs in my code are currently grouped together with expand and collapse functionality. It works well, except for the fact that I have to click a button twice in order to open another div. Initially, the first click only collapses the first div. ...

Do the material cards in Angular 7 resemble the layout of Pinterest?

How can I achieve a Pinterest-like layout for Angular Material cards? Here is my current code: <div fxFlex fxLayout="column" fxLayoutGap="10px" style="height: 100vh"> <div fxLayout="row wrap"> <!-- loop over the cardList and show the ...

How to make a checkbox list appear bold when checked in AngularJS?

<div class='someClass'> <label ng-repeat="item in itemList"> <input type='checkbox' checklist-model='itemCheckList' checklist-value='item.name'> <span class=& ...

Interactive website featuring 3DSMax .obj and .max models with advanced AJAX clickable functionalities

I have a 3DSMax model in both .obj and .max file formats. This model includes clickable points that work perfectly within 3DSMax, displaying details when clicked. My goal is to showcase this interactive model on the web with all its clickable features int ...

Run Python scripts on imported files

I am facing an issue with my django application where I need to upload 2 files and run a python script (proto2.py) on them. In the HTML code, I included a button to trigger the file execution but it did not work: <div>Relay 1: <form action=" ...

Disabled button is set, yet I am still able to click on it

Below is the HAML code snippet: %a.btn.btn-primary.personlistbtn{href:patients_path, :target => "_blank", :disabled => 'disabled'} Person List This is how it appears in the Inspect Element: <a class="btn btn-primary personlistbtn" di ...

Troubleshooting a problem with the Jquery cycle plugin in HTML and CSS

Hi there! I've successfully integrated the jQuery cycle plugin into my slideshow, which is working great. However, I want to make the navigation controls (previous, next, pause, play) display as background images instead of visible text links. I' ...

Ways to resolve the issue with the Google Map API when attempting to print the entire page

When I click on the Print Button in maps, I want to print exactly what the user sees. However, for some reason, the map changes completely. All I'm looking for is that the map resizes the image to perfectly fit the Print, regardless of whether it end ...

Add an event listener to a dynamically created div block through jQuery when it is clicked

When the page loads, a dynamic div appears that is visible to the user and in Firebug, but is not available in the page source. The content within this div changes dynamically. I am attempting to bind a click event to this div so that when a user clicks o ...