Utilizing Breakpoints to reorder columns in the Bootstrap grid system

This is the HTML code I am working with:

<div class="container-fluid h-100">
  <div class="row no-gutters h-100">
    <div class="col-12 col-md-6 left">
      Column 1
    </div>
    <div class="col-12 col-md-6 left">
      Column 2
    </div>
  </div>
</div>

How can I modify the column structure in Bootstrap using CSS breakpoints to display Column1 above Column2 when the screen width is less than 720px?

Answer №1

To make changes to the grid tiers, you can update the following variables:

$grid-breakpoints: (
  xs: 0,
  sm: 720px,
  md: 768px,
  lg: 1024px
);

$container-max-widths: (
  sm: 660px,
  md: 720px,
  lg: 960px
);

This means that any viewport width less than 720 pixels will be classified as sm, resulting in the application of col-12 to grid cells.

Answer №2

To modify this, you can play around with the flex directions. Below is an illustration using your provided code snippet:

<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="583a37372c2b2c2a3928186c766e7668">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet"/>

<div class="container-fluid h-100">
  <div class="row flex-column-reverse flex-md-row no-gutters h-100">
    <div class="col-12 col-md-6">
      Column 1
    </div>
    <div class="col-12 col-md-6">
      Column 2
    </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

jQuery is missing which is required for jquery-ui-1.9.2 and jquery-migrate-1.1.1 to function properly

Attempting to troubleshoot issues with the mobile version of my website has been quite a challenge. While I've made some progress, I have encountered four errors in the Google Chrome console that are hindering the functionality of certain links on the ...

What is the method for utilizing alpha transparency in MPDF?

I am currently working with MPDF to generate a PDF file with a full-page background. I want to create a layout similar to the image shown https://i.sstatic.net/RoH3r.png. I believe that I need to incorporate alpha transparency, but I am unsure of how to d ...

Having trouble with Fancybox loading images from an external URL?

Here is an example of functioning HTML code: <a class="fancybox-gallery" href="http://sale.coupsoft.com/uploads/938218/logo.png"> <img class="animate scale animated" src="http://sale.coupsoft.com/uploads/938218/logo.png" alt="Image1"> ...

Creating a form in PHP with the power of JavaScript, AJAX, and jQuery

I have successfully created a registration form using HTML, processed the data with PHP, and utilized javascript, ajax, and jquery. However, I am facing an issue where I want to display a notification stating whether the operation was "inserted/failed" on ...

Exploring the Depths of HTML with Jquery

This is an example of HTML code I am working with: <tr> <td> <div><span id="temp" /> </div> </td> </tr> <tr> <td> <div><span id="temp" /> </di ...

Issue with Bootstrap: unable to align columns vertically

I am currently learning how to use bootstrap, but I am facing a challenge with vertical alignment of columns. Despite trying various methods, I can't seem to get the content to align anywhere other than the top. Even starting from scratch with code fr ...

Implementing Event Handlers for Multiple Textareas Using Jquery on a Webpage

The functionality of my script is exactly how I want it to be, but I am facing an issue when trying to replicate it on a page. The jQuery code manipulates textarea boxes based on button clicks, however, I now need each textarea box to have its own set of b ...

Mastering Sprite Movement in JavaScript: Going Forward with Your Sprite

Currently, I am developing a JavaScript game that utilizes the canvas functionality in HTML 5. I am looking to create projectiles that are capable of moving towards a specific coordinate by using a vector2 (x, y) as the velocity. Is there a mathematical fo ...

What is the best way to retrieve the input value from post.ejs?

app.js var express = require('express'); var bodyParser = require('body-parser'); var app = express(); var passport = require('passport'); var localStrategy = require('passport-local'); var axios = require("axi ...

How can I automatically disable certain checkboxes when a specific radio button is selected?

Looking to disable certain checkboxes when a specific radio button is selected. For instance, selecting the first radio button with the id="pz1" should disable checkboxes with matching id values from the thisToppings array. Each radio button cor ...

What is the best way to incorporate multiple HTML buttons that utilize the same JavaScript function within looped results?

My HTML page contains the following codes: <input type="text" class="woocommerce-Input woocommerce-Input--text input-text" name="metin" placeholder="Geben Sie Artikel Nr" style="width: 30%;"/><br/><br/> <input type="button" class="sin ...

Issue with bootstrap accordion not collapsing other open tabs automatically

I'm struggling to incorporate a Bootstrap accordion collapse feature into my project, specifically with the auto-collapsing functionality. In the scenario where there are 3 divs labeled A, B, and C, if A is open and I click on B, A should automaticall ...

Locate blank input fields within a group - using jQuery

In my quest to identify empty input elements such as textboxes, select dropdowns, and list items within a jQuery result set denoted as (requiredfields) - $requiredFields = $(".f-form-required.f-form-field").filter(function(){ if($(':input:not([typ ...

To ensure responsiveness in JavaScript, adjust the width to 100%

Recently, I came across this piece of code: <div style="text-align:center; max-width:500px; width:100%; margin:auto"> <script type="text/javascript" src="transition_example.js"></script></div> Here is the content of transition ...

Discovering all class names following the same naming convention and storing them in an array through Javascript

Hey everyone, I could use some assistance with a coding challenge. I'm aiming to extract all class names from the DOM that share a common naming convention and store them in an array. For instance: <div class="userName_342">John</div> & ...

Exploring the use of dictionaries within Django templates

views.py: return render(request,'images.html',temp) Temp Data: {'cluster1': ['temp/vinoth/cluster1/demo-pic94.jpg', 'temp/vinoth/cluster1/id1.jpg'], 'cluster2': ['temp/vinoth/cluster2/demo-pic94.jp ...

Using Delphi's TWebBrowser as an HTML Editor to retrieve font attributes

In my Delphi7 application, I am utilizing TWebBrowser as an HTML editor. To enable editing capabilities, I set its designMode to 'on' in the OnDocumentComplete event. While I have successfully managed to change font properties such as bold, ital ...

Having trouble verifying the selection option in Angular 6

I've been trying to implement Select option validation in Angular 6, but neither Aria-required nor required seem to be effective. The requirement is for it to display a message or show a RED border similar to HTML forms. Here's the HTML snippet ...

Turn words into smiley faces without having to refresh the page

Recently, I came across an interesting feature on Facebook where text in messages is automatically converted into smiley faces without the need to reload the page. This got me thinking about how I could recreate this same functionality using jQuery and HTM ...

Is there a way to navigate through div text within a stationary container?

My current challenge involves a container that contains an overflow of text, but I desire for the container to remain fixed. The dilemma arises when the text spills out from both the top and bottom edges of the container. Instead of using scroll bars withi ...