Tips for arranging two jumbotrons with proper spacing in Bootstrap without stacking them vertically while using the mr-1 class

My issue involves two jumbotrons, each with a col-md-6 class, positioned nicely next to each other. Currently, they are contained within a modal, but for the sake of example, I have created a fiddle without the modal to showcase the same behavior. If I apply the mr-1 class to the left jumbotron, it causes them to stack on top of each other, which makes sense. However, I am looking for a way to add some space between the jumbotrons without them touching while still maintaining their 6-column width and stacking on mobile devices. I vaguely remember Bootstrap having a solution for this scenario without causing them to stack?

Below is the code snippet:

<div class="container col-12">
    <div class="row">
        <div class="jumbotron col-md-6">
            Some text.
        </div>
        <div class="jumbotron col-md-6">
            Some more text.
        </div>
  </div>
</div>

Jumbotrons in Fiddle

Answer №1

Incorporating the jumbotron within your col-md-6 will allow you to observe the spaces around them ;)

 <div class="container col-12">
    <div class="row">
        <div class="col-md-6">
        <div class="jumbotron">
            Some text.
        </div>
        </div>
        <div class="col-md-6">
        <div class="jumbotron">
            Some text.
        </div>
        </div>
  </div>
</div>

Check out this Sample Fiddle for reference

I trust this information proves to be helpful.

-Assistance :)

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

Mastering the technique of showcasing landscape using CSS3

I'm working on an HTML and CSS3 report with multiple columns. I am trying to print it in landscape orientation using HTML and CSS3. I attempted rotating the body and table, but only half of the table is visible while the other half is cut off or hidde ...

jsTree unable to locate node using the provided ID

Implementing the jsTree on the webpage is not a problem for me. I have experimented with numerous suggestions from different sources. $('#myTree').jstree({ .... }) .on('loaded.jstree', function (e, dta) { var t = $('#myTree&a ...

Mastering the alignment of Material-UI Menu items

When using the menu and menu item components of material-ui to create a select dropdown menu, I encountered an unusual issue where the dropdown menu always expands to the left side of the box, as shown in the image below: https://i.stack.imgur.com/ykRrp.jp ...

Understanding the Intrinsic Dimensions of Replaced Elements in CSS

I'm currently facing some challenges with the CSS Intrinsic & Extrinsic Sizing Module Level 3, specifically chapter 4.1 on Intrinsic Sizes. This section is proving to be quite difficult for me: When a block-level or inline-level replaced element h ...

How to position a centered div with a background image on a webpage

I am trying to achieve a centered layout for a div and its content on a webpage. The div includes a background image. Here is my approach using Flexbox: <head> <style> .flex_container { display: flex; flex-d ...

What are the steps for positioning material-ui icons to the right?

I have a list that is dynamically generated with the following code snippet: <list className = "todos-list"> {allTodos.map((todo, index)=> { return ( ...

Error encountered when attempting to send a jQuery Post to API due to Access-Control-Allow-Origin issue

I've been researching the 'Access-Control-Allow-Origin' error extensively, but I am still struggling to understand what needs to be fixed. Here's the code snippet in question: $.ajax({ url: 'http://54.149.190.45:8000/image/upl ...

I encountered an issue with my shopping cart while using ReactJS

this is the App.js file import React from "react"; import ListProduct from "./listProduct"; import ListOrder from "./listOrder"; import pizza from "./pizza.jpg"; import './style.css' import { Container,Row,Col,Button } from 'react-boo ...

Issues arise when a questionnaire is duplicated

Currently, I am working on a questionnaire that involves the cloning feature in jQuery using .clone(). The questions are answered using checkboxes with options for yes or no. These checkboxes are placed within a table and controlled by the following script ...

Tips for displaying text gradually when hovering over a button

Is there a way to make text appear slowly on hover of a button without it coming from the bottom to the right? I attempted using transition:all 5s;, but encountered the issue of the text moving from the bottom to the right due to improper width. Is there a ...

Incorporate R Variables into Shiny HTML

Here are three files that demonstrate my question and the structure of my program. I am looking to utilize the bootstrap card and include an R variable (such as the result of a calculation) within it. Is there a method to achieve this using HTML in a separ ...

Exploring nested elements with JQuery

When utilizing Jquery... I aim to search for a specific element within a parent div, regardless of its nested position within the parent element. After finding these elements, I will then search through them and based on their values, enable or disable o ...

What is the process for collapsing Kendo Grid headers?

My current task is rather unusual. I have been tasked with collapsing all data rows of a Kendo grid to its header. While I am familiar with collapsing to groups, this particular requirement seems quite challenging. Below is the proposed design for the Ken ...

The most efficient method for interacting with externally generated HTML in Rails

For my Rails page help documentation, I utilized the HelpNDoc help authoring tool to generate a folder containing HTML pages and additional folders for JavaScript, images, stylesheets, and libraries. Now I am seeking the most efficient way to integrate thi ...

What is the most effective method for capturing the URL of a quiz's results page?

Picture yourself taking a quiz on mysite/test/universe (URL = 'universe') or mysite/test/earth (URL = 'earth'). Once you choose your answers and hit Submit, you are directed to a static page at mysite/test/results.php. The form automati ...

Determine the presence of an image by using a wildcard in the URL

I need to show an image, and if it doesn't exist I want to display a default image. The challenge is that the image can come with any extension. Can someone suggest how I can modify the $.get() function in the code snippet below to make it search for ...

Arranging items in a vertical column using CSS based on the content

I am facing an issue with aligning the values in a column under each other without percentages using my own html code, css, and bootstrap classes: <div class="d-flex"> <p class="table-string">91.86</p> <span ...

Troubleshooting problems with Bootstrap cards on mobile devices

I've encountered an issue on small devices with the Bootstrap card. I'm using a hover effect to slide up the content, but on small devices, the content is cutting off the image. I'm not sure how to position the content directly after the ima ...

What is the reason for using grid-lines instead of row and column numbers to position an item on the CSS grid?

During a recent tech presentation I delivered at my workplace on the new CSS grid spec, my manager posed an intriguing question that left me stumped. He wanted to know why elements positioned within a grid are identified based on the grid lines they fall b ...

Searching with Jquery Ajax

For my search functionality, I am utilizing ajax jquery js. I found this useful code snippet here: However, I am facing some challenges with the following Javascript code: <script language="JavaScript" type="text/javascript"> <!-- function searc ...