"Creating a stunning mosaic layout with Bootstrap 4's Grid

After successfully creating a small mosaic using Bootstrap 3, I attempted to reuse it on a site with Bootstrap 4 only to encounter a frustrating issue. The mosaic that once worked perfectly is now broken and not displaying correctly. You can see the working mosaic here and the broken mosaic here.

Below is the HTML code for the mosaic:

<div class="container">
    <div class="row">
      <div class="col-md-8 col-lg-6 B"></div>
      <div class="col-md-4 col-lg-3 G"></div>
      <div class="col-md-4 col-lg-3 G"></div>
      <div class="col-md-12 col-lg-6 O"></div>
    </div>
</div>

And here is the CSS code used:

.row > div {border:10px solid white}
.B {background:blue; height:200px}
.G {background:green; height:100px}
.O {background:orange; height:100px}

I'm trying to figure out what went wrong during the transition from Bootstrap 3 to Bootstrap 4. Is there a solution to fix this without having to use JavaScript? Any help or insights would be greatly appreciated!

Thank you in advance!

Answer №1

To customize Bootstrap 4 flexbox, you can utilize the display and float utilities provided in the framework.

<div class="container">
    <div class="row d-block">
        <div class="col-md-8 col-lg-6 float-left B"></div>
        <div class="col-md-4 col-lg-3 float-left G"></div>
        <div class="col-md-4 col-lg-3 float-left G"></div>
        <div class="col-md-12 col-lg-6 float-left O"></div>
    </div>
</div>

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

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

Header and Column Fixed Table

I'm struggling with a fixed header and fixed column table issue. The header stays in place, but the column doesn't. How can I solve this problem? I've attempted to use the position: fixed property on the first column, but it's not worki ...

Developing an editor

Currently, I am delving into the concept of object inheritance in JavaScript through a practical exercise where I am creating an online editor similar to the one I am currently using. However, I find myself slightly confused as I aim to utilize data-* att ...

The text becomes jumbled and messy when the browser is resized

I came across this fantastic header design > https://codepen.io/rm/pen/ldhon <. However, I noticed that when the window is resized, the text ends up overlapping. In the demo provided, resizing the window too much causes the issue to become apparent, ...

Utilizing version 4 of Bootstrap to create a visually appealing full

I am currently using the latest version of bootstrap, but I have encountered an issue with my sidebar being too short and not reaching full height. You can view the problem here: Is this problem caused by my CSS or is it a bootstrap issue? And how can ...

My div element isn't responding to border radius adjustments on the top left and right corners

I'm trying to achieve curved corners at the top left and top right of my div, but the border-top-left-radius and border-top-right-radius properties don't seem to work for me. Here is the HTML code: <div id="trape"></div> And the C ...

Adding CSS style to an Image Resource in GWT: a step-by-step guide

Currently working with GWT and have an Image Resource object in use. For instance, ImageResource image = ClientResources.of().images().icon(); Looking to add some CSS styles to this image, however being that it's an ImageResource and not an Image o ...

A tutorial on how to customize the hover effect for TableHead Column Identifiers in MaterialUI by adjusting

I'm struggling to customize the appearance of child th elements using the TableHead component from MaterialUI. While I've been successful in modifying various properties, I'm facing difficulty in changing the hover color. Below is the snipp ...

Tips for applying a CSS class with a smooth fade-out effect

In my Angular project, I am working on creating a custom notification component. Here is the template code I have so far: <aside *ngFor="let message of messages "> <div class="notification" style="position:fixed"> {{message.conten ...

Is it possible to stack images on top of each other on a webpage?

I'm looking to create a dress-up game website where users can click on different accessories to layer them on top of each other. It's a bit tricky to explain, but I've found some examples that demonstrate what I have in mind: This site is ...

What is the best way to dismiss a Bootstrap modal with a form inside after submitting the form?

Within a Bootstrap modal, I have a form and I want to automatically close the modal when the user clicks the submit button. Here's the code snippet: export class AddPartModalComponent implements OnInit { @Input() id:number; closeResult: string ...

The current code lacks any form of line breaks

While attempting to edit a CSS file in Sublime Text 2, I noticed that all the code is displayed without any line breaks. This makes it difficult to read and work with. Is there a way to fix this issue and format the code into readable sections? ...

Searching for data in a bootstrap table that is not case-sensitive

Searching for and highlighting text within a bootstrap table has proven to be a challenge. Check out the Fiddle for an example: https://jsfiddle.net/99x50s2s/74/ HTML <table class='table table-bordered'> <thead> <tr& ...

Guide on incorporating a glyphicon into a dropdown menu link by leveraging the link_to helper in Ruby on Rails

Just getting started here and I have a question... I want to include glyphicons on the links in a dropdown menu using the link_to helper in my Ruby on Rails app. This is the code I currently have: <ul class="nav_item pull-right"> <li cla ...

Several target elements on a single page

I am currently facing a problem with maintaining the active state of one anchor tag's target while clicking another button within the main identifier. Upon clicking the INTEL button, its opacity changes from 0 to 1. However, upon clicking Data Histor ...

Leveraging AngularJS for refreshing information within Bootstrap tabs

I am working on an Angular page that contains two Bootstrap tabs structured like this: <div> <ul class="nav nav-tabs"> <li class="active strong"> <a data-target="#home" data-toggle="tab">Tab 1</a> ...

What is the best way to incorporate rounded images into a Bootstrap carousel?

Struggling to display only the rounded images when using a bootstrap carousel. Even with overflow:hidden, it's not working as intended. Seeking assistance on how to achieve this! ...

Is there a way to increase the size of the icon without altering the dimensions of the button?

After implementing a code snippet to enable a button to copy the URL to the clipboard, I encountered an issue. Originally, the button displayed the text "copy," which changed to "copied" after clicking on it and reverted back after 2 seconds. However, I d ...

Is there a way to arrange the navigation items to appear on the right side upon toggler click?

I've been trying to get the nav-items to align on the right side, but so far using the ms-auto class from Bootstrap isn't giving me the desired result. <html lang="en"> <head> <!-- Required meta tags --> < ...

Styling problem arises on IOS devices due to rounded corners affecting select box

The dropdown menu I am using to "sort products" on our WordPress website is causing some styling issues specifically on IOS devices. I would like the dropdown menu to have rounded corners. It seems to display rounded corners on IOS, but it still shows the ...

Why is it that consolidating all my jQuery plugins into one file is ineffective?

Prior to this, I included the following scripts: <script type="text/javascript" src="{{MEDIA_URL}}js/plugins/json2.js"></script> <script type="text/javascript" src="{{MEDIA_URL}}js/plugins/jquery-msdropdown/js/jquery.dd.js"></script&g ...