Bootstrap Tutorial

Bootstrap Fixed Navbar | Sticky Top | Sticky Header Bootstrap CDN 5.3, 5.2, 4.6, 4.3, 3.4, 3.3 (New Links) | Bootstrap CDN 5, 4, 3 File Download Bootstrap 5 Modal Disable Outside Click Bootstrap Horizontal and Vertical Divider Bootstrap Modal Pass data Dynamically Bootstrap Confirm Delete Modal | Popup Bootstrap Add Space Between Rows | Margin Bootstrap Remove Modal Background Bootstrap Make Table Row Clickable Bootstrap Change modal background color Bootstrap Center Align Form Bootstrap Show Image in Modal | Popup Bootstrap Button Icon with Text Bootstrap Scrollable Modal Bootstrap Image Center Align Bootstrap Dropdown with Icon Bootstrap Get Checkbox checked value Bootstrap Uncheck radio Button Bootstrap Set Radio button default checked or selected Bootstrap Radio Button Validation Bootstrap Enable Disable Radio Button Bootstrap Radio Button Checked Event Bootstrap get radio button checked or selected value Bootstrap Disable Enable Button on Click Bootstrap Tooltip on Input Field Elements Bootstrap Fixed Footer Bootstrap Image Upload | file Upload Bootstrap Modal on page load Bootstrap Login Form Template Bootstrap Add Search icon with Search bar Bootstrap button tooltip on hover Bootstrap Icons CDN Latest Version (1.11.3) Bootstrap Tabs Panel Pass dynamic content Bootstrap Change Dropdown Menu Background Color Bootstrap Avoid Dropdown Menu to close menu items on clicking inside Bootstrap Table Remove Border Bootstrap Modal Example Bootstrap Center Align Input Field Bootstrap Change Icon Color Bootstrap Text Align Center | Middle Bootstrap Remove all Rounded Corners Bootstrap Alerts Example Bootstrap Alert with Icons Bootstrap Scroll to Top Button Bootstrap Button Loading Spinner Bootstrap Check if Modal is Shown or Hidden Bootstrap Dropdown Button Change Text on Selection Bootstrap Remove offcanvas Backdrop Bootstrap Textarea Height Auto Resize Bootstrap selectpicker Get Selected Value Glyph Trash Icon

Bootstrap Add Space Between Rows | Margin

Bootstrap Add Space Between Rows | Margin:In Bootstrap, you can add space between rows by utilizing the margin utility classes. By default, rows have negative margins to compensate for the padding of the columns inside them. To create space between rows, you can apply a margin utility class, such as "mb-3" (margin-bottom: 1rem), to each row. This will add a 1rem space below each row, creating a visual separation between them. Adjust the margin class according to your desired spacing needs, and you can easily control the vertical spacing between Bootstrap rows.

Profile Photo

Abhishek Yadav (SD) SDE of FAI

Feedback

written
Profile Photo

Anil Kumar (Expert) Coding Expert of FAI

Feeback

reviewed
Profile Photo
May 21, 2023 01:05 AM Last Updated
updated

How can you add space between rows or create a margin in Bootstrap?

The given code snippet demonstrates how to add space between rows using Bootstrap's margin utility classes. The container <div> contains three sets of rows, each with two columns.

The mb-4 class is added to the row elements to add a margin-bottom of 1.5rem (or 24 pixels) between the rows.

Additionally, different background colors and text color are applied to each row using Bootstrap's background and text utility classes (e.g., bg-light, bg-secondary, bg-dark, and text-light). This helps to visually distinguish the rows.

Bootstrap Add Space Between Rows | Margin Example

Copied to Clipboard
Run

Output of Bootstrap Add Space Between Rows | Margin

How can I add space between rows in Bootstrap using custom CSS?

This code snippet demonstrates how to add space between rows in Bootstrap using custom CSS. The CSS class .custom-row-spacing is defined with a margin-bottom property of 20px, which creates a vertical space between rows.

The rows are assigned different background colors using the classes .row1, .row2, and .row3. The rows contain two columns each, represented by <div> elements with the class .col. The entire layout is wrapped within a <div> with the class .container.

Bootstrap Add Space Between Rows in using Custom Css

Copied to Clipboard
Run

Output of Bootstrap Add Space Between Rows in using Custom Css

Ad