A guide to changing the height of a column in Bootstrap

I've utilized Bootstrap to create features in the HTML, and I'm attempting to make each box's height consistent. Check out a screenshot of the boxes here

#hr-1 {
  width: 100px;
  margin-left: 20%;
}

#features {
  background-color: #f0f8ff67;
  border-radius: 50px;
  padding: 50px 20px;
}

#cont2 {
  border-right: 2px solid #000;
}

.feature {
  background-color: #f0f8ff47;
  border-radius: 25px;
  padding: 20px;
  height: 100%;
}

.feature:hover {
  background-color: #f0f8ff87;
}

.feature>img {
  margin-bottom: 1rem;
}
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c1a3aeaeb5b2b5b3a0b181f4eff1eff3">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">

<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7e1c11110a0d0a0c1f0e3e4b504e504c">[email protected]</a>/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
<div class="container-fluid" id="features">
  <div class="row">
    <div class="col-md-4 px-4 textw" id="cont2">
      <h3>What We Develop</h3>
      <hr id="hr-1">
      <p>Looking for a web development agency to bring your vision to life? We specialize in creating exceptional websites and applications tailored to your needs. Our experienced team ensures user-friendly, secure, and scalable results. With a proven track
        record, we'll transform your web application dreams into reality. Contact us now and let's achieve your online goals together.</p>
    </div>
    <div class="col-md-8">
      <div class="container-fluid">
        <div class="row align-content-between">
          <div class="col-xxl-3 col-xl-4 col-lg-6">
            <div class="feature-wrapper m-1">
              <div class="feature">
                <img src="./images/layers.png" alt="layers icon" style="width: 50px;">
                <h3 class="fs-4 text-body-emphasis">Custom Web Application Development</h3>
                <p>Our agency offers bespoke web application development services to cater to your specific business requirements. Whether you need a customer management system, inventory tracking solution, or a booking platform, we have you covered.</p>
              </div>
            </div>
          </div>
          <div class="col-xxl-3 col-xl-4 col-lg-6">
            <div class="feature-wrapper m-1">
              <div class="feature">
                <img src="./images/online-shop.png" alt="shopping icon" style="width: 50px;">
                <h3 class="fs-4 text-body-emphasis">E-commerce Solutions</h3>
                <p>We specialize in building robust and user-friendly e-commerce websites that enable seamless online shopping experiences for your customers. From product catalog management to secure payment gateways, we ensure a secure and efficient online
                  selling platform.</p>
              </div>
            </div>
          </div>
          <div class="col-xxl-3 col-xl-4 col-lg-6">
            <div class="feature-wrapper m-1">
              <div class="feature">
                <img src="./images/pencil.png" alt="shopping icon" style="width: 50px;">
                <h3 class="fs-4 text-body-emphasis">Content Management Systems (CMS)</h3>
                <p>Our agency develops powerful CMS platforms that empower you to easily manage and update your website's content. With intuitive interfaces and flexible functionalities, you can effortlessly create and publish engaging content.</p>
              </div>
            </div>
          </div>
          <div class="col-xxl-3 col-xl-4 col-lg-6">
            <div class="feature-wrapper m-1">
              <div class="feature">
                <img src="./images/message.png" alt="shopping icon" style="width: 50px;">
                <h3 class="fs-4 text-body-emphasis">Responsive Web Design</h3>
                <p>We prioritize responsive web design, ensuring your website looks great and functions flawlessly across all devices, including desktops, tablets, and smartphones. This approach guarantees a consistent user experience and maximizes your
                  reach to diverse audiences.</p>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

I've experimented with setting the height to 100%, using display: flex;, and even tried .h100 from Bootstrap, but nothing seems to work for me.

Thank you for any assistance!

Nico

Answer №1

It appears that some minor adjustments are needed in your HTML:

<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="54363b3b20272026352414617a677a64">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-9ndCyUaIbzAi2FUVXJi0CjmCapSmO7SnpJef0486qhLnuZ2cdeRhO02iuK6FUUVM" crossorigin="anonymous">
<div class="container-fluid" id="features">
        <div class="row">
            <div class="col-md-4 px-4 textw" id="cont2">
                <h3>What We Develop</h3>
                <hr id="hr-1">
                <p>Looking for a web development agency to bring your vision to life? We specialize in creating exceptional websites and applications tailored to your needs. Our experienced team ensures user-friendly, secure, and scalable results. With a proven track record, we'll transform your web application dreams into reality. Contact us now and let's achieve your online goals together.</p>
            </div>
            <div class="col-md-8">
                <div class="container-fluid">
                    <div class="row align-content-between">
                      <div class="col-xxl-3 col-xl-4 col-lg-6 d-flex align-items-stretch">
                        <div class="feature-wrapper m-1 h-100 p-1">
                          <div class="feature h-100">
                            <img src="./images/layers.png" alt="layers icon" style="width: 50px;">
                            <h3 class="fs-4 text-body-emphasis">Custom Web Application Development</h3>
                            <p>Our agency offers bespoke web application development services to cater to your specific business requirements. Whether you need a customer management system, inventory tracking solution, or a booking platform, we have you covered.</p>
                          </div>
                        </div>
                      </div>
                      <div class="col-xxl-3 col-xl-4 col-lg-6 d-flex align-items-stretch">
                        <div class="feature-wrapper m-1 h-100 p-1" >
                          <div class="feature h-100">
                            <img src="./images/online-shop.png" alt="shopping icon" style="width: 50px;">
                            <h3 class="fs-4 text-body-emphasis">E-commerce Solutions</h3>
                            <p>We specialize in building robust and user-friendly e-commerce websites that enable seamless online shopping experiences for your customers. From product catalog management to secure payment gateways, we ensure a secure and efficient online selling platform.</p>
                          </div>
                        </div>
                      </div>
                      <div class="col-xxl-3 col-xl-4 col-lg-6 d-flex align-items-stretch">
                        <div class="feature-wrapper m-1  h-100 p-1">
                          <div class="feature h-100">
                            <img src="./images/pencil.png" alt="shopping icon" style="width: 50px;">
                            <h3 class="fs-4 text-body-emphasis">Content Management Systems (CMS)</h3>
                            <p>Our agency develops powerful CMS platforms that empower you to easily manage and update your website's content. With intuitive interfaces and flexible functionalities, you can effortlessly create and publish engaging content.</p>
                          </div>
                        </div>
                      </div>
                      <div class="col-xxl-3 col-xl-4 col-lg-6 d-flex align-items-stretch">
                        <div class="feature-wrapper m-1 h-100 p-1">
                          <div class="feature h-100">
                            <img src="./images/message.png" alt="shopping icon" style="width: 50px;">
                            <h3 class="fs-4 text-body-emphasis">Responsive Web Design</h3>
                            <p>We prioritize responsive web design, ensuring your website looks great and functions flawlessly across all devices, including desktops, tablets, and smartphones. This approach guarantees a consistent user experience and maximizes your reach to diverse audiences.</p>
                          </div>
                        </div>
                      </div>
                    </div>
                </div>
            </div>
        </div>
    </div>.com)

A modification was made by adding align-items-stretch on the container, allowing each container to fill the height of its parent (row).

Additionally, h-100 was added to each child div of the container so that they also occupy the full height of their respective parent.

To finalize the changes, a padding with p-1 was included.

You can view the complete code on my CodePen page here

Answer №2

It's challenging to differentiate as you haven't provided it like in typical online coding editors.

<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="04666b6b70777076657444302a302a35">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="container-fluid" id="features">
  <div class="row">
    <div class="col-md-4 px-4 textw" id="cont2">
      <h3>What We Develop</h3>
      <hr id="hr-1">
      <p>Looking for a web development agency to bring your vision to life? We specialize in creating exceptional websites and applications tailored to your needs. Our experienced team ensures user-friendly, secure, and scalable results. With a proven track
        record, we'll transform your web application dreams into reality. Contact us now and let's achieve your online goals together.</p>
    </div>
    <div class="col-md-8">
      <div class="container-fluid">
        <div class="row align-content-between">
          <div class="col-6 col-md-3">
            <div class="feature-wrapper m-1">
              <div class="feature">
                <img src="./images/layers.png" alt="layers icon" style="width: 50px;">
                <h3 class="fs-4 text-body-emphasis">Custom Web Application Development</h3>
                <p>Our agency offers bespoke web application development services to cater to your specific business requirements. Whether you need a customer management system, inventory tracking solution, or a booking platform, we have you covered.</p>
              </div>
            </div>
          </div>
          <div class="col-6 col-md-3">
            <div class="feature-wrapper m-1">
              <div class="feature">
                <img src="./images/online-shop.png" alt="shopping icon" style="width: 50px;">
                <h3 class="fs-4 text-body-emphasis">E-commerce Solutions</h3>
                <p>We specialize in building robust and user-friendly e-commerce websites that enable seamless online shopping experiences for your customers. From product catalog management to secure payment gateways, we ensure a secure and efficient online
                  selling platform.</p>
              </div>
            </div>
          </div>
          <div class="col-6 col-md-3">
            <div class="feature-wrapper m-1">
              <div class="feature">
                <img src="./images/pencil.png" alt="shopping icon" style="width: 50px;">
                <h3 class="fs-4 text-body-emphasis">Content Management Systems (CMS)</h3>
                <p>Our agency develops powerful CMS platforms that empower you to easily manage and update your website's content. With intuitive interfaces and flexible functionalities, you can effortlessly create and publish engaging content.</p>
              </div>
            </div>
          </div>
          <div class="col-6 col-md-3">
            <div class="feature-wrapper m-1">
              <div class="feature">
                <img src="./images/message.png" alt="shopping icon" style="width: 50px;">
                <h3 class="fs-4 text-body-emphasis">Responsive Web Design</h3>
                <p>We prioritize responsive web design, ensuring your website looks great and functions flawlessly across all devices, including desktops, tablets, and smartphones. This approach guarantees a consistent user experience and maximizes your
                  reach to diverse audiences.</p>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

I made adjustments to the column classes for the features in the updated code to be col-6 col-md-3, ensuring equal widths on small and larger screens and one-third of the width on medium screens.

Answer №3

Adjusted the height of the container-fluid element by adding the h-100 class. This will ensure that child elements can inherit the height set to 100%.

Applied flexbox to the feature div by including the d-flex flex-column classes. This sets the direction of the feature box as a column, allowing child elements to stretch vertically.

Implemented the align-items-stretch class to the row to make sure columns stretch vertically to match the tallest column's height.

These modifications will result in feature boxes with uniform height across all columns. Feel free to customize the styling and include additional features as needed.

 <div class="container-fluid" id="features">
   <div class="row">
      <div class="col-md-4 px-4 textw" id="cont2">
         <h3>What We Develop</h3>
         <hr id="hr-1">
         <p>Seeking a web development agency to bring your ideas to life? Our team specializes in crafting exceptional websites and applications tailored to your requirements. Count on our expertise to deliver user-friendly, secure, and scalable solutions for your project needs. Let us turn your web application aspirations into reality with our established track record. Contact us today to reach your online objectives together.</p>
      </div>
      <div class="col-md-8">
         <div class="container-fluid h-100">
            <div class="row align-items-stretch">
               <div class="col-xxl-3 col-xl-4 col-lg-6">
                  <div class="feature-wrapper m-1">
                     <div class="feature d-flex flex-column">
                        <img src="./images/layers.png" alt="layers icon" style="width: 50px;">
                        <h3 class="fs-4 text-body-emphasis">Custom Web Application Development</h3>
                        <p>Our agency provides tailor-made web application development services to meet your specific business needs. Whether you require a customer management system, inventory tracking solution, or booking platform, we have the expertise to assist.</p>
                     </div>
                  </div>
               </div>
               <!-- Include additional feature columns following the same structure -->
            </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

How to automatically close a JavaScript popup once a form is submitted and refresh the parent page

I am facing an issue with a popup on my website. I have a separate page called math.ejs that pops up when a button is pressed on the index.ejs page. However, after clicking the submit Ok button in the math.ejs popup, I want it to close and display the calc ...

Retrieve data from an API and store it in a JSON array

My website is having an issue where it's fetching data from an API and displaying it in a table, but all the cells are returning undefined values. The data in the API is structured as an array with multiple datasets inside curly braces that I am unsu ...

What happens when a browser can support multiple versions of a font - which one does it choose

If I have two versions of a font, customFont1.woff2 and customFont1.woff, and I list the woff2 version first followed by the woff version in the font declaration file, what happens when the browser supports both formats? Will it download both fonts or ju ...

Refresh the block's content seamlessly without the need for a page reload

Within the index.html page There exists a block called content that contains various content blocks. An additional navigation menu with numerous links is present. It is important that when you click on a menu link, the content within the content block re ...

iOS Safari: Full-width header with fixed position exceeding viewport width

Encountered an issue specific to Safari on iOS. Creating a page with a fixed position header that spans the width of the viewport. The content consists of multiple images that should scroll horizontally while the header remains in place during scrolling. ...

Internet Explorer experiencing printing issues

Can anyone explain why IE (8,9 Tested) is refusing to print the right side of this coupon on the red background? The left side (phone number) prints fine. Other browsers like Chrome and Firefox print the whole document correctly. To see the bug, you can ...

How can I position a Button at the center of my Grid item using Material UI?

In my React 16.13.0 application, I am utilizing Material UI's Grid and trying to center the content of a button in the middle of a row. Here is what I have tried: center: { alignItems: "center", width: "100%", }, halfRow: { width: "5 ...

Creating a banner image that scrolls while maintaining a fixed size

I'm looking to add a banner image with a scrolling effect as users navigate down the page, but I'm not sure what this technique is called. An example of what I'm trying to achieve can be seen on this site. As the user scrolls down, the res ...

Simultaneously Implementing JQuery's fadeIn and Load Functions

Currently, I am utilizing the Jquery load function to refresh specific parts of a webpage. The page loaded by the load function only displays content in the div if certain database parameters are satisfied. However, my issue is that when new content is ren ...

Trouble Aligning Bootstrap Dropdown Menu Link with Other Navbar Links

Issue with dropdown links not aligning properly in the Bootstrap navbar. The positioning seems off and can be seen in the screenshot provided where the blue outline represents the ".dropdown" https://i.stack.imgur.com/QmG7v.png Facing a similar problem a ...

What steps should be taken to validate an HTML5 form without actually submitting it?

I am working on a form that includes various HTML attributes such as: <form> <label>Full Name</label> <input type="text" name="firstname" class="span3" required="required"> <label>Email Address</label&g ...

The top value in CSS animation fails to change properly

Can anyone help me figure out why the animation doesn't work when I try to change the vertical position of a form using JQuery? I want the input field to smoothly move to its new position so that users can see it happening. Here is the JsFiddle link: ...

What are the steps to create a horizontal submenu in WordPress?

Is there a way to change the default vertical sub menu of my main menu to horizontal? The CSS for the sub menu in stylesheet.css is as follows: .main-nav>ul>li .sub-menu> li { padding:0 20px; } .main-nav>ul>li .sub-menu> li:first-ch ...

When attempting to print a Bootstrap 4 HTML page in Chrome, the browser headers and footers are being clipped

Currently experiencing an issue with printing an HTML page styled using Bootstrap 4 (Bootstrap 3.3.7 works fine) on Chrome where the header and footer are partly covered up. Take a look at this screenshot to see what I mean - the date, title, and file/url ...

Which specific html container or element can be found on the mymsn pages?

When accessing mymsn, users have the ability to personalize the content and layout of their webpage. I am curious about what type of container is being utilized for this customization - does it involve an html element, or perhaps javascript, or something e ...

What is the best way to create a sliding <nav> effect when a <div> is clicked?

Hello! I am looking for a solution that will cause the navigation contents to slide out from the left when the div class "bt-menu" is clicked. It should also slide back in to the left either when the div is clicked again or when anywhere outside of the nav ...

Is there a way to ensure that the div is displayed on the same line?

Check out the jsfiddle link provided: http://jsfiddle.net/HE7yT/ I'm trying to align the Image, content, and Amount in the same line. How can I achieve this? The goal is to have "150" displayed on the same line as the picture. var HTML = $(' ...

Modify the paragraph content upon clicking

After experimenting with JavaScript to switch images, I now want to explore how to do the same with text. My dilemma lies in having 10 different paragraphs (where each link corresponds to a specific paragraph), but I'm unsure of where to input these ...

Kayak flight search presents a challenge for retrieving the div tag by class name using BeautifulSoup and Chrome driver

I am struggling to correctly identify the valid search results using a classname and then scrape prices from them. Despite my efforts, the code still fails to recognize the class. I initially believed that Selenium could locate the tag post-rendering, but ...

Right-align the text in the title of the material card

Why isn't the CSS aligning my title of matcard to the right? <mat-card [ngStyle]="{ 'margin':'5px','height':'130px'}"> <mat-card-header> <mat-card-title [ngStyle]="{ 'text-align': ...