Issue with Bootstrap: Nested column disappears upon reaching the breaking point

I want to create a grid with 3 columns, each containing a nested grid with 2 columns (one smaller than the other).

When the breakpoint is reached, I want the columns to stack on top of each other. However, one of the nested columns disappears after the breakpoint.

This is the code I have used:

@import url("https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css");

.row {
  background: #f8f9fa;
}

.col {
  border: solid 1px #6c757d;
  padding: 40px;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="82f2edf2f2e7f0ace8f1c2b3acb3b4acb2">[email protected]</a>/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script>


<div class="container-fluid">
  <div class="row">
    <div class="col-lg">
      <div class="row">
        <div class="col col-lg-4">
          icon
        </div>
        <div class="col col-lg-8">
          text
        </div>
      </div>
    </div>
    <div class="col-lg">
    <div class="row">
        <div class="col col-lg-4">
          icon
        </div>
        <div class="col col-lg-8">
          text
        </div>
      </div>
    </div>
    <div class="col-lg">
    <div class="row">
        <div class="col col-lg-4">
          icon
        </div>
        <div class="col col-lg-8">
          text
        </div>
      </div>
    </div>
  </div>
</div>

When the breakpoint is reached, nested columns stack up properly, but the parent columns do not. The main issue I am facing is that the column with the icon disappears completely after the large breakpoint.

I would like the layout to look like this once the large breakpoint is reached:

Nested layout once breakpoint is reached

However, this is what actually happens:

Screen record of my layout on my website

Since this is my first time using Bootstrap, I understand that I may be making a mistake. Can anyone point out where I might be going wrong?

Answer №1

Utilizing intertwined rows excessively is unnecessary. Consider utilizing columns within a single row to solve the issue.

I suggest reconsidering the "padding:40px" feature in the example provided. The excessive padding is causing the items to not fit properly into the 12-column grid system.

.row {
  background: #f8f9fa;
  text-align: center;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">

<div class="container-fluid">
  <div class="row d-flex align-items-center">
    <!-- d-flex added-->

    <!-- First Column -->
    <div class=" padding col-sm-12 col-lg-1">
      <img class="img-fluid" width="200" src="https://cdn2.iconfinder.com/data/icons/investment-26/64/investment-16-512.png" alt="">
    </div>
    <div class=" padding col-sm-12 col-lg-3">
      <h2>Usability</h2>
      <p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Laudantium sed vitae corrupti modi quam tempore, aut, reprehenderit praesentium odio sint recusandae eos voluptatibus ut beatae assumenda dignissimos explicabo hic voluptatum.</p>
    </div>

    <!-- Second Column -->
    <div class="padding col-sm-12 col-lg-1">
      <img class="img-fluid" width="200" src="https://cdn2.iconfinder.com/data/icons/investment-26/64/investment-16-512.png" alt="">
    </div>
    <div class="padding col-sm-12 col-lg-3">
      <h2>Parallax effect</h2>
      <p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Laudantium sed vitae corrupti modi quam tempore, aut, reprehenderit praesentium odio sint recusandae eos voluptatibus ut beatae assumenda dignissimos explicabo hic voluptatum.</p>
    </div>

    <!-- Third Column -->
    <div class="padding col-sm-12 col-lg-1">
      <img class="img-fluid" width="200" src="https://cdn2.iconfinder.com/data/icons/investment-26/64/investment-16-512.png" alt="">
    </div>
    <div class="padding col-sm-12 col-lg-3">
      <h2>Unlimited colors</h2>
      <p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Laudantium sed vitae corrupti modi quam tempore, aut, reprehenderit praesentium odio sint recusandae eos voluptatibus ut beatae assumenda dignissimos explicabo hic voluptatum.</p>
    </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

Position the center button evenly between two images, aligned vertically using percentages

I'm attempting to achieve a specific layout that includes images scaling across Bootstrap breakpoints and a static button position. The challenge is maintaining the layout as depicted in the mockup, regardless of image size. The images are set to im ...

How to place a div with 100% width at the bottom of a float with a fixed width

Each day the same question seems to pop up, yet this particular issue has me stumped... My goal is a simple one - I aim to design a fixed width layout with 3 columns, while ensuring that the header and footer stretch across 100% of the screen. Everything ...

Transferring information from website form to a C# program

Someone suggested using the HTTPListener class, but it appears to only return another web page in response. I need guidance on how to post data from a form on my website and process it in my C# application. If anyone has tutorials or simple examples, the ...

Make sure link opens in the same window/tab

Currently, I am utilizing the Open Link in Same Tab extension on Google Chrome. This extension can be found here. The purpose of this extension is to ensure that all links open in the same window/tab, which is necessary for touch screen kiosk left/right s ...

Filling an HTML template with an $http response in VueJS

After learning about VueJs, I decided to embark on a small project - a nutrition app where food recommendations are made based on specific nutrients. Below is the JavaScript code snippet: recommendFood: function() { this.recs = {}; ...

After uploading my website, I noticed that one of the tabs appears in Chinese

After uploading my website, I noticed that one of the tabs (more info) is displaying in Chinese for some unknown reason. I'm not sure why this is happening. Here is the URL: You can also check out the code here: http://pastebin.com/jFBUV1ga ...

Overlap of Bootstrap Columns Occurs When Resizing the Browser

While I recognize that this issue is common, I have extensively reviewed similar questions but could not find a solution. <div class="container"> <div class="row"> <div class="col-xs-12 col-sm-12 col-md-6"> <img style="wi ...

Parsing HTML with a simple DOM parser

I am utilizing the simple php dom parser in my project. Within my loaded dom, there is a link that appears like this in html: <a href="...">Some const tesxt</a> I am wondering how I can utilize the find function to select this particular obje ...

Is it possible to utilize window.location.replace function within an iframe?

Is it possible to use window.location.replace to bypass history and target on-page anchors without page reloads, but encounter issues when working within iframes? The main problem seems to be a CSP (content security policy) violation for script-src ' ...

As the width decreases in animation, the content gradually disappears until it reaches zero

My issue involves red and black divs; when I hover over the parent element, the red div should appear by expanding to its full width. However, a problem arises when the width is set to 0px as the content still shows. Can someone provide assistance on how t ...

JavaScript / html Error: function body missing closing curly brace

I encountered an error that I'm struggling to resolve: "SyntaxError: missing } after function body". Despite not having a function named 'body', I have attempted changing every instance of 'body' in my script. However, ...

Creating a Consistent Look for Italic Font Formatting in Tailwind

In an effort to establish consistent typography on a website being developed by my team, we have devised custom utility classes in Tailwind. One of these classes, small-italicized, also requires the text to be italicized. However, it seems that the fontSiz ...

The CSS transition fails to function correctly once a specific function is executed

When I hover over a div, the background color changes due to a transition effect. However, if I click on a button that triggers myFunction2 to change the background color of the div before hovering over it, the transition effect no longer works. functi ...

The website is unresponsive to the media query

Currently, I am working on a project using Windows 10, Codeigniter, jQuery, and Firefox 43.0.4. However, I am facing an issue that is quite baffling to me. My goal is to apply styles specifically for an iPad-sized window, so I have implemented the followin ...

Troubleshooting: Why isn't External CSS Functioning Properly in Broadleaf

I have encountered a question regarding the use of a custom email template in broadleaf. It seems that I am unable to apply an external CSS file and can only use inline styles. Is this normal behavior, or am I missing something? Below is how I am attempti ...

Validation of Coldfusion Forms: File Input

What is the best way to determine in ColdFusion if a user has selected a file for upload to the server? Using IsDefined function doesn't provide that information. ...

Personalizing Google Map pin

I found some code on Codepen to add pointers to a Google map. Currently, it's using default markers but I want to change them to my own. However, I'm not sure where in the code to make this update. Any examples or guidance would be appreciated. ...

Adjusting the transparency of the background without altering its colors

I need help figuring out how to merge custom palettes I've created such as this one, which resulted in a .css and .less file. While I want to retain the colors, I also require certain elements' backgrounds to be transparent. To achieve this, I c ...

What is the method for toggling background URLs?

Currently, I am utilizing flaunt.js by Todd Moto for my navigation system. My goal is to seamlessly switch the hamburger image with another image when the mobile-menu is shown and hidden. Check out the demo here. For a detailed tutorial, visit this link. ...

Establishing a primary color for all text in Vuetify

How can I set a base color for all text in a Vue + Vuetify project? I attempted to change the theme's primary color in vuetify.ts: export default new Vuetify({ theme: { themes: { light: { primary: "#E53935", }, }, }, } ...