Flexbox styling using BootStrap's row class is a dynamic and versatile

Is there a way to create space between the four divs in the image below?

https://i.sstatic.net/xHzbF.png

As shown in the image, there are four divs aligned next to each other.

The code for each individual div is:

<div class="col-lg-3 col-md-4 col-sm-6 mb-5 text-center">....</div>

The parent for these divs is:

<div class="d-flex row mx-auto" style={{ justifyContent: "space-around",alignContent:'center' }}>
....
</div>

The full structure is:

<div className="container mt-5 mb-5">
    <div class="d-flex row mx-auto" style={{ justifyContent: "space-around",alignContent:'center' }}>
        <div class="col-lg-3 col-md-4 col-sm-6 mb-5 text-center">
         ....
         ....
        </div>
    </div>
</div>

Answer №1

Have you attempted applying margin to individual div elements?

<div class="col-lg-3 col-md-4 col-sm-6 mb-5 text-center" style="margin: 10px">....</div>

After successful implementation, you can later expand it to a custom class.

.spacing {
  margin: 10px;
}


<div class="col-lg-3 col-md-4 col-sm-6 mb-5 text-center spacing">....</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

The curly brackets in Vue.js do not function properly within a v-for loop when there is an object nested inside an array

I am a novice in vuejs and I am attempting to utilize mustache {{}} to render elements of an array. It works fine for simple arrays, but when I try it with an array containing objects, it doesn't seem to work. Is there an issue with my code, or is it ...

Having trouble with the expand feature of Bootstrap 5 navbar

I am facing an issue with my Bootstrap 5 navbar as it only extends as wide as the contents within it. I want the navbar to expand the entire length of the container but changing the navbar-expand-?? setting doesn't seem to have any effect. https://i.s ...

Using Jquery Chosen Plugin to Dynamically Populate One Chosen Selection Based on Another

Good evening to all, please excuse any errors in my English. I have successfully integrated a jQuery Chosen plugin with my 'estado' field (or province). My goal is to populate another jQuery Chosen plugin with the cities corresponding to that s ...

Issue with JQuery click() not triggering on a specific div button

I am attempting to replicate a user's click on a website where I have no control over the code. The specific element I am trying to interact with is a div that functions as a button. <div role="button" class="c-T-S a-b a-b-B a-b-Ma oU v2" aria-dis ...

Learning the ropes of off-canvas design with Bootstrap 3

I'm really struggling to understand how to implement off-canvas functionality in Bootstrap 3. I've searched for examples, but I just can't seem to grasp it. My navigation is set up, but I'm unsure how to make the off-canvas feature work ...

What's the deal with inline blocks and text in the middle?

Check out this code I created for a navigation bar. HTML : <div class="header-nav"> <div class="header"> <img src="../Pictures/LifeFrame/2.jpg" width="100%" height="100px" /> </div> <div class="nav" align="c ...

django displaying a blank screen

I'm having trouble with the code, forms.py from django.form import datetime, widgets import datetime import calendar from bootstrap_datepicker.widgets import Datepicker class DateForm(forms.Form): date_1=forms.DateTimeField(widget=DatePicker( ...

One of my AngularJS directives seems to be malfunctioning while the rest are working fine. Can you help me troubleshoot

Recently, I've been immersing myself in the job search process and decided to create a website as a sort of online resume while also learning AngularJS. I enrolled in the Angular course on CodeSchool and am slowly building my website to my liking. (Pl ...

"Effortless alignment: Centralizing CSS styling across the entire

I need help placing a loading spinner in the center of my screen, ensuring it works on both mobile and desktop devices. Here is my current CSS code: .spinner { width: 100px; height: 100px; position:absolute; top: 50%; left: 50%; margin: 100px ...

Unique hover tags such as those provided by Thinglink

Looking for a way to replicate the functionality of Thinglink? Imagine a dot on an image that, when hovered over, displays a text box - that's what I'm trying to achieve. I thought about using tooltips in Bootstrap, but I'm not sure if it ...

How can I input text into separate tabs using a specific method?

I've been struggling with this issue for a while now and here's the code I have so far: <html> <head> <script src="http://mihaifrentiu.com/wp-content/themes/mf/js/jquery_1.7.1.min.js" type="text/javascript"></scr ...

default browser's drag and reposition feature

I'm trying to make an image draggable on my webpage by using default browser behavior, but it's not working for some reason. Here is the code snippet I'm using: <div style="position:relative;width:1000px; height:900px;border:solid;z-inde ...

The Html is not having JavaScript executed before it

Within my header, there is a script that is making a call to a web API in order to populate a view model. The script is as follows: @using GigHub.Controllers @using GigHub.ViewModel @model GigHub.ViewModel.ProjectsViewModel @{ ViewBag.Title = "Projects"; ...

Angular and WEB API experiencing issues with the update function synchronization

Currently, I'm developing a CRUD example using dotnet core and Angular. In the backend, I have implemented a function in the CarController.cs as shown below: CarController.cs [Route("UpdateCar")] [HttpPut] public IActionResult Put([ ...

Issue with navigational button layout

I am facing an issue while designing my navigation menu with 4 circular items spaced about 20 px apart on the top right of the screen. I have managed to style each nav item as a circle, but when I try to position them in the upper right corner, only the 4t ...

Unlock the Power of Vue Draggable in Vue.js 3 with These Simple Steps

When attempting to implement Draggable in Vue.js 3, I encountered an error message: VueCompilerError: v-slot can only be used on components or <template> tags. Below is a snippet of my code: <draggable tag="transiton-group" name="s ...

The <img> tag needs to dynamically adjust its size based on the width of its parent element, while ensuring it does not exceed its original dimensions

I spent hours working on my tribute page project on codepen and managed to pass 9 test cases. However, no matter what I try, I just can't seem to pass the last test case. My CSS code: #img-div { display: block; filter: grayscale(100%); width: 1 ...

How can I translate an entity diagram (.vpp) into a database or text file using Java?

Is there a way in Java to convert an entity diagram into a database table or text file? If so, how can this be accomplished? Is it possible to export the .vpp file to an HTML file and then convert the HTML file into a text file? Any help would be greatly ...

Adding Jquery content to HTML templates using Jinja2: A Simple Guide

Looking at my HTML code Base.html <title> {% block title %}{% endblock %} </title> </head> <body> <nav class="navbar navbar-expand-lg navbar-light bg-light"> <div class="collapse na ...

Tips for resolving conflicts between CSS files

My index.html file contains multiple css and js files, including MaterializeCSS and a style.css file. However, when both are included simultaneously, using elements from Materialize such as tabs results in them not appearing correctly. Despite initializing ...