Bootstrap – Slider Demo

Bootstrap – Slider Demo ”; Previous Next Bootstrap provides a few different options for styling Navigation slider. Some of examples are as shown below − Example Description Download link Slide menu on over This example indicates about Slider Menu structure in Bootstrap Download Sub Menu This example indicates about Slider Sub Menu structure in Bootstrap Download Sidebar With Tabs This example indicates about Slider With Tabs structure in Bootstrap Download Tabs This example indicates about Tabs structure in Bootstrap Download Print Page Previous Next Advertisements ”;

Bootstrap – Backgrounds

Bootstrap – Background ”; Previous Next This chapter discusses about the background color utility classes and the gradients that can be used with these classes. Accessibility tip: Use of color to the background just provides a visual indication, and this will not be helpful to users of assistive technologies like screen readers. Make sure that the meaning is clear from the content itself. Use alternative means to add clarity to the content using the .visually-hidden class. Background color Like the contextual color classes for text, you can apply any contextual class to set the background of an element. Keep in mind that background utilities do not affect color, therefore, certain situations may require the use of .text-* color utilities. Let us see an example: Example You can edit and try running this code using the Edit & Run option. <!DOCTYPE html> <html lang=”en”> <head> <title>Bootstrap Background</title> <meta charset=”UTF-8″> <meta http-equiv=”X-UA-Compatible” content=”IE=edge”> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> <link href=”https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css” rel=”stylesheet”> <script src=”https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js”></script> </head> <body> <h4>Background color utilities</h4> <!–success color–> <div class=”p-3 mb-2 bg-success text-white”>background utility –> .bg-success</div> <div class=”p-3 mb-2 bg-success-subtle text-emphasis-success”>background utility subtle–> .bg-success-subtle</div> <!–warning color–> <div class=”p-3 mb-2 bg-warning text-dark”>background utility –> .bg-warning</div> <div class=”p-3 mb-2 bg-warning-subtle text-emphasis-warning”>background utility subtle –> .bg-warning-subtle</div> <!–info color–> <div class=”p-3 mb-2 bg-info text-dark”>background utility –> .bg-info</div> <div class=”p-3 mb-2 bg-info-subtle text-emphasis-info”>background utility subtle–> .bg-info-subtle</div> <!–dark color–> <div class=”p-3 mb-2 bg-dark text-white”>background utility –> .bg-dark</div> <div class=”p-3 mb-2 bg-dark-subtle text-emphasis-dark”>background utility subtle–> .bg-dark-subtle</div> <!–primary color–> <div class=”p-2 mb-2 bg-primary text-white”>background utility –> .bg-primary</div> <div class=”p-3 mb-2 bg-primary-subtle text-emphasis-primary”>background utility subtle–> .bg-primary-subtle</div> <!–light color–> <div class=”p-3 mb-2 bg-light text-dark”>background utility –> .bg-light</div> <div class=”p-3 mb-2 bg-light-subtle text-emphasis-light”>background utility subtle–> .bg-light-subtle</div> <!–secondary color–> <div class=”p-3 mb-2 bg-secondary text-white”>background utility –> .bg-secondary</div> <div class=”p-3 mb-2 bg-secondary-subtle text-emphasis-secondary”>background utility subtle–> .bg-secondary-subtle</div> <!–body color–> <div class=”p-3 mb-2 bg-body text-body”>background utility –> .bg-body</div> <div class=”p-3 mb-2 bg-black text-white”>background utility subtle–> .bg-black</div> <!–danger color–> <div class=”p-3 mb-2 bg-danger text-white”>background utility –> .bg-danger</div> <div class=”p-3 mb-2 bg-danger-subtle text-emphasis-danger”>background utility subtle–> .bg-danger-subtle</div> <!–white color–> <div class=”p-3 mb-2 bg-white text-dark”>background utility –> .bg-white</div> <div class=”p-3 mb-2 bg-transparent text-body”>background utility subtle–> .bg-transparent</div> <!–secondary and tertiary color–> <p class=”p-3 mb-2 bg-body-secondary”>background utility –> .bg-body-secondary</p> <p class=”p-3 mb-2 bg-body-tertiary”>background utility –> .bg-body-tertiary</p> </body> </html> Background gradient The addition of a .bg-gradient class results in a linear gradient being applied to the backgrounds, commencing with a partially transparent white hue that gradually fades towards the bottom. In order to add a gradient in your custom CSS, just add background-image: var(–bs-gradient);. Let us see an example of .bg-gradient class: Example You can edit and try running this code using the Edit & Run option. <!DOCTYPE html> <!DOCTYPE html> <html lang=”en”> <head> <title>Bootstrap Background</title> <meta charset=”UTF-8″> <meta http-equiv=”X-UA-Compatible” content=”IE=edge”> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> <link href=”https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css” rel=”stylesheet”> <script src=”https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js”></script> </head> <body> <div class=”container mt-3″> <h4>Background color utilities</h4> <!–success color–> <div class=”p-3 mb-2 bg-success text-white”>background utility –> .bg-success</div> <div class=”p-3 mb-2 bg-success bg-gradient text-white”>background gradient utility –> .bg-success bg-gradient</div> <!–warning color–> <div class=”p-3 mb-2 bg-warning text-dark”>background utility –> .bg-warning</div> <div class=”p-3 mb-2 bg-warning bg-gradient text-emphasis-warning”>background gradient utility –> .bg-warning bg-gradient</div> <!–info color–> <div class=”p-3 mb-2 bg-info text-dark”>background utility –> .bg-info</div> <div class=”p-3 mb-2 bg-info bg-gradient text-emphasis-info”>background gradient utility–> .bg-info bg-gradient</div> <!–dark color–> <div class=”p-3 mb-2 bg-dark text-white”>background utility –> .bg-dark</div> <div class=”p-3 mb-2 bg-dark bg-gradient text-white”>background gradient utility –> .bg-dark bg-gradient</div> <!–primary color–> <div class=”p-2 mb-2 bg-primary text-white”>background utility –> .bg-primary</div> <div class=”p-3 mb-2 bg-primary bg-gradient text-white”>background gradient utility–> .bg-primary bg-gradient</div> <!–light color–> <div class=”p-3 mb-2 bg-light text-dark”>background utility –> .bg-light</div> <div class=”p-3 mb-2 bg-light bg-gradient text-emphasis-light”>background gradient utility–> .bg-light bg-gradient</div> <!–secondary color–> <div class=”p-3 mb-2 bg-secondary text-white”>background utility –> .bg-secondary</div> <div class=”p-3 mb-2 bg-secondary bg-gradient text-white”>background gradient utility–> .bg-secondary bg-gradient</div> <!–body color–> <div class=”p-3 mb-2 bg-body text-body”>background utility –> .bg-body</div> <div class=”p-3 mb-2 bg-black bg-gradient text-white”>background gradient utility–> .bg-black bg-gradient</div> <!–danger color–> <div class=”p-3 mb-2 bg-danger text-white”>background utility –> .bg-danger</div> <div class=”p-3 mb-2 bg-danger bg-gradient text-white”>background gradient utility–> .bg-danger bg-gradient</div> </div> </body> </html> Opacity To change the opacity of the background color, either override –bs-bg-opacity via custom styles or inline styles or choose from the available utility .bg-opacity. Let us see an example where the CSS variable is overriden: Example You can edit and try running this code using the Edit & Run option. <!DOCTYPE html> <html lang=”en”> <head> <title>Bootstrap Background</title> <meta charset=”UTF-8″> <meta http-equiv=”X-UA-Compatible” content=”IE=edge”> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> <link href=”https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css” rel=”stylesheet”> <script src=”https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js”></script> </head> <body> <div class=”container mt-3″> <h4>Background opacity – override CSS variable</h4> <div class=”bg-danger p-2 text-white”>Default danger background</div> <div class=”bg-danger p-2″ style=”–bs-bg-opacity: .5;”>50% opacity of danger background</div> </div> </body> </html> Let us see an example where .bg-opacity is used: Example You can edit and try running this code using the Edit & Run option. <!DOCTYPE html> <html lang=”en”> <head> <title>Bootstrap Background</title> <meta charset=”UTF-8″> <meta http-equiv=”X-UA-Compatible” content=”IE=edge”> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> <link href=”https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css” rel=”stylesheet”> <script src=”https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js”></script> </head> <body> <div class=”container mt-3″> <h4>Background opacity utility</h4> <div class=”bg-primary p-2 text-white”>Primary default background</div> <div class=”bg-primary p-2 text-dark bg-opacity-10″>10% opacity on primary background</div> <div class=”bg-primary p-2 text-dark bg-opacity-25″>25% opacity on primary background</div> <div class=”bg-primary p-2 text-dark bg-opacity-50″>50% opacity on primary background</div> <div class=”bg-primary p-2 text-dark bg-opacity-75″>75% opacity primary background</div> </div> </body> </html> Print Page Previous Next Advertisements ”;

Bootstrap – Buttons Demo

Bootstrap – Buttons Demo ”; Previous Next Bootstrap provides some options to style buttons. Use utilities to design unique buttons for any application, which are summarized in the following table − Sr.No. Class & Description 1 btn Default/ Standard button. 2 btn-primary Provides extra visual weight and identifies the primary action in a set of buttons. 3 btn-success Indicates a successful or positive action. 4 btn-info Contextual button for informational alert messages. 5 btn-warning Indicates caution should be taken with this action. 6 btn-danger Indicates a dangerous or potentially negative action. 7 btn-link Deemphasize a button by making it look like a link while maintaining button behavior. Example Description Download link IOS Buttons This example indicates about button structure in Bootstrap Download Block Buttons This example indicates about block button structure in Bootstrap Download Icon Buttons This example indicates about icon button structure in Bootstrap Download Spinner Buttons This example indicates about spinner button structure in Bootstrap Download Close Buttons This example indicates about close button structure in Bootstrap Download Print Page Previous Next Advertisements ”;

Bootstrap – Position

Bootstrap – Position ”; Previous Next This chapter discusses about configuration of position of an element. Bootstrap provides a set of helper classes to set the position of an element on a page. Some of the classes provided by Bootstrap are as follows:. .fixed-top .fixed-bottom .sticky-top .sticky-bottom Let us see examples for each set of classes. Fixed top The class .fixed-top sets the position of an element at the top of the viewport, from edge to edge. This is useful for creating navigation bars or headers that remain visible at the top of the screen even as the user scrolls down. Example You can edit and try running this code using the Edit & Run option. <!DOCTYPE html> <html> <head> <title>Position – Fixed top</title> <meta charset=”UTF-8″> <meta http-equiv=”X-UA-Compatible” content=”IE=edge”> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> <link href=”https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css” rel=”stylesheet”> <script src=”https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js”></script> </head> <body style=”height:1500px”> <nav class=”navbar navbar-expand-lg text-bg-success navbar-dark fixed-top”> <div class=”container-fluid”> <a class=”navbar-brand” href=”#”>Use of .fixed-top class</a> </div> </nav> <div class=”container-fluid” style=”margin-top:80px”> <h4>Position fixed at top</h4> <p>The class .fixed-top of Bootstrap sets the position of the element at top of the screen.</p> <h1>Scroll down the page to see the position</h1> </div> </body> </html> Fixed bottom The class .fixed-bottom sets the position of an element at the bottom of the viewport, from edge to edge. Example You can edit and try running this code using the Edit & Run option. <!DOCTYPE html> <html> <head> <title>Position – Fixed bottom</title> <meta charset=”UTF-8″> <meta http-equiv=”X-UA-Compatible” content=”IE=edge”> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> <link href=”https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css” rel=”stylesheet”> <script src=”https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js”></script> </head> <body style=”height:1500px”> <nav class=”navbar navbar-expand-lg text-bg-primary navbar-dark fixed-bottom”> <div class=”container-fluid”> <a class=”navbar-brand” href=”#”>Use of .fixed-bottom class</a> </div> </nav> <div class=”container-fluid” style=”margin-top:80px”> <h4>Position fixed at bottom</h4> <p>The class .fixed-bottom of Bootstrap sets the position of the element at the bottom of the page.</p> <h1>Scroll down the page to see the position</h1> </div> </body> </html> Sticky top The class .sticky-top is used to create a sticky element that remains at the top of the screen, from edge to edge, but only after you scroll past it. Example You can edit and try running this code using the Edit & Run option. <!DOCTYPE html> <html lang=”en”> <head> <title>Position – Sticky top</title> <meta charset=”UTF-8″> <meta http-equiv=”X-UA-Compatible” content=”IE=edge”> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> <link href=”https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css” rel=”stylesheet”> <script src=”https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js”></script> </head> <body style=”height:1500px”> <div class=”container-fluid mt-3″> <h3>Sticky Navbar</h3> <p>The class <b>.sticky-top</b> is used to create a sticky element that remains at the top of the screen, from edge to edge, but only after you scroll past it.</p> <p>Scroll down the page to see the effect.</p> </div> <nav class=”navbar navbar-expand-lg bg-dark navbar-dark sticky-top”> <div class=”container-fluid”> <a class=”navbar-brand” href=”#”>Sticky top</a> </div> </nav> <div class=”container-fluid”> <p>Example for .sticky-top class of Bootstrap to set the position of an element, like a navbar, stick to the top of the screen.</p> <p>Example for .sticky-top class of Bootstrap to set the position of an element, like a navbar, stick to the top of the screen.</p> <p>Example for .sticky-top class of Bootstrap to set the position of an element, like a navbar, stick to the top of the screen.</p> <p>Example for .sticky-top class of Bootstrap to set the position of an element, like a navbar, stick to the top of the screen.</p> <p>Example for .sticky-top class of Bootstrap to set the position of an element, like a navbar, stick to the top of the screen.</p> <p>Example for .sticky-top class of Bootstrap to set the position of an element, like a navbar, stick to the top of the screen.</p> <p>Example for .sticky-top class of Bootstrap to set the position of an element, like a navbar, stick to the top of the screen.</p> </div> </body> </html> Responsive sticky top Responsive sticky top classes are used in web design to create a navigation menu or header that sticks to the top of the screen as the user scrolls down the page. This ensures that the navigation menu is always visible and easily accessible, even as the user moves further down the page. Some of the responsive sticky top classes provided by Bootstrap are as follows: .sticky-sm-top sticks the position of element(s) to top on small sized viewports .sticky-md-top sticks the position of element(s) to top on medium sized viewports .sticky-lg-top sticks the position of element(s) to top on large sized viewports .sticky-xl-top sticks the position of element(s) to top on extra large sized viewports .sticky-xxl-top sticks the position of element(s) to top on extra extra large sized viewports Let us see an example: Note: Resize your browser to see the change. Example You can edit and try running this code using the Edit & Run option. <!DOCTYPE html> <html lang=”en”> <head> <title>Position – Responsive Sticky top</title> <meta charset=”UTF-8″> <meta http-equiv=”X-UA-Compatible” content=”IE=edge”> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> <link href=”https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css” rel=”stylesheet”> <script src=”https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js”></script> </head> <body style=”height:1500px”> <div class=”container-fluid mt-3″> <h3>Sticky Navbar</h3> <p>The class <b>.sticky-lg-top</b> is a responsive class, used to create a sticky element that remains at the top of the screen, from edge to edge, but only after you scroll past it.</p> <p>Scroll down the page to see the effect.</p> </div> <nav class=”navbar navbar-expand-lg bg-dark navbar-dark sticky-lg-top”> <div class=”container-fluid”> <a class=”navbar-brand” href=”#”>Responsive Sticky top</a> </div> </nav> <div class=”container-fluid”> <p>Example for .sticky-lg-top class of Bootstrap to set the position of an element, like a navbar, stick to the top of the screen.</p> <p>Example for .sticky-lg-top class of Bootstrap to set the position of an element, like a navbar, stick to the top of the screen.</p> <p>Example for .sticky-lg-top class of Bootstrap to set the position of an element, like a navbar, stick to the top of the screen.</p> <p>Example for .sticky-lg-top class of Bootstrap to set the position of an element, like a navbar, stick to the

Bootstrap – Carousel Demo

Bootstrap – Carousel demo ”; Previous Next What is a carousel? A carousel in bootstrap is a slideshow component that allows users to display multiple images, videos, or other types of content in a looping sequence. It is a responsive and dynamic component that can be easily customized. Bootstrap provides a set of classes that can be used to create a carousel component and customize it. Two main classes for adding carousel are: class description .carousel This class sets up the basic structure of the carousel .carousel-item This class is used to define the individual slides within the carousel Optional classes to customize the slides in a carousel are: class description .slide Adds a sliding animation to the carousel .active Defines the initial active slide .carousel-indicators Adds navigation indicators to the bottom of the carousel .carousel-control-prev and carousel-control-next Adds left and right arrow buttons to the carousel for manual navigation .carousel-caption Adds a caption or description to each slide in the carousel Some of the examples of the carousels are as follows: Example Description Download link Basic carousel This example shows a basic carousel. Download Carousel with indicators This example shows a carousel with indicators. Download Carousel with captions This example shows a carousel with captions. Download Animated carousel This example shows a carousel with animation. Download Carousel with time interval This example shows a carousel with time interval. Download Autoplay carousel This example shows an autoplay carousel. Download Print Page Previous Next Advertisements ”;

Bootstrap – Position

Bootstrap – Position ”; Previous Next This chapter discusses about the .position utility classes for quick configuration of the position of an element. Position values The .position classes are available for quick positioning, but they are not responsive in nature. The various values for position class are as follows: .position-static .position-relative .position-absolute .position-fixed .position-sticky Let us see an example: Example You can edit and try running this code using the Edit & Run option. <!DOCTYPE html> <html lang=”en”> <head> <title>Bootstrap – Position</title> <meta charset=”UTF-8″> <meta http-equiv=”X-UA-Compatible” content=”IE=edge”> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> <link href=”https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css” rel=”stylesheet”> <script src=”https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js”></script> </head> <body class=”m-2″> <h4 class=”mb-4″>Position values</h4> <div class=”container mt-4 bg-light border border-dark”> Position: static states that the top, right, bottom, and left properties will be the same no matter <p class=”position-static bg-info top-50 start-50 text-light”>position: static</p> This part is out of the paragraph. </div> <div class=”container mt-4 bg-light border border-dark”> Position: relative sets its position to be relative with respect to the elements on top of it <p class=”position-relative bg-success top-50 start-50 text-light w-50″> position: relative; </p> This means that the top, right, bottom, and left properties will affect the position of the Paragraph. </div> <div class=”container mt-4 bg-light border border-dark”> Position: absolute sets its position relative to the closest parent and it set its position absolute with that. <p class=”position-absolute bg-warning bottom-0 end-50 text-light”> position: absolute; </p> This means that the top, right, bottom, and left properties will get adjusted with respect to the nearest ancestor and then the position is set. </div> </body> </html> Arrange elements Elements can be arranged easily with the edge positioning utility classes. The format for arranging the elements is {property}-{position}. where property can hold following values: property description top vertical top position start horizontal left position (LTR) bottom vertical bottom position end horizontal right position (LTR) where position can hold following values: position description 0 0 edge position 50 50% edge position 100 100% edge position Note: More position values can be added by making entries to the $position-values Sass map variable. Let us see an example of arrangement of elements using the .position-* class: Example You can edit and try running this code using the Edit & Run option. <!DOCTYPE html> <html lang=”en”> <head> <title>Bootstrap – Position</title> <meta charset=”UTF-8″> <meta http-equiv=”X-UA-Compatible” content=”IE=edge”> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> <link href=”https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css” rel=”stylesheet”> <script src=”https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js”></script> </head> <body class=”container p-3 m-5″> <div class=”position-absolute top-0 start-0 mb-2″> <button type=”button” class=”btn btn-primary”>top-0 start-0</button> </div> <div class=”position-absolute top-50 start-50 mb-2″> <button type=”button” class=”btn btn-secondary”>top-50 start-50</button> </div> <div class=”position-absolute top-0 end-0 mb-2″> <button type=”button” class=”btn btn-success”>top-0 end-0</button> </div> <div class=”position-absolute bottom-0 start-0 mb-2″> <button type=”button” class=”btn btn-warning”>bottom-0 start-0</button> </div> <div class=”position-absolute bottom-50 end-50 mb-2″> <button type=”button” class=”btn btn-danger”>bottom-50 end-50</button> </div> <div class=”position-absolute bottom-0 end-0 mb-2″> <button type=”button” class=”btn btn-info”>bottom-0 end-0</button> </div> </div> </body> </html> Center elements Using the transform utility class .translate-middle, you can arrange the elements in the center. The transform class applies the transformations translateX(-50%) and translateY(-50%) to an element. This element then combines with edge positioning utilities and thus centers the element. Let us see an example: Example You can edit and try running this code using the Edit & Run option. <!DOCTYPE html> <html lang=”en”> <head> <title>Bootstrap – Position</title> <meta charset=”UTF-8″> <meta http-equiv=”X-UA-Compatible” content=”IE=edge”> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> <link href=”https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css” rel=”stylesheet”> <script src=”https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js”></script> <style> span { border: 2px solid rgb(26, 58, 241); padding: 30px; background:#1ae3f1; } </style> </head> <body> <div class=”container”> <div class=”position-absolute top-0 start-0 translate-middle”> <span></span> </div> <div class=”position-absolute top-0 start-50 translate-middle”> <span></span> </div> <div class=”position-absolute top-0 start-100 translate-middle”> <span></span> </div> <div class=”position-absolute top-50 start-0 translate-middle”> <span></span> </div> <div class=”position-absolute top-50 start-50 translate-middle”> <span></span> </div> <div class=”position-absolute top-50 start-100 translate-middle”> <span></span> </div> <div class=”position-absolute top-100 start-0 translate-middle”> <span></span> </div> <div class=”position-absolute top-100 start-50 translate-middle”> <span></span> </div> <div class=”position-absolute top-100 start-100 translate-middle”> <span></span> </div> </div> </body> </html> Use .translate-middle-x or .translate-middle-y classes, in order to position the elements only in horizontal or vertical direction. Let us see an example: Example You can edit and try running this code using the Edit & Run option. <!DOCTYPE html> <html lang=”en”> <head> <title>Bootstrap – Position</title> <meta charset=”UTF-8″> <meta http-equiv=”X-UA-Compatible” content=”IE=edge”> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> <link href=”https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css” rel=”stylesheet”> <script src=”https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js”></script> <style> span { border: 2px solid rgb(26, 58, 241); padding: 30px; background:#dd1c8c; } </style> </head> <body> <div class=”position-static”> <div class=”position-absolute top-0 start-0″> <span></span> </div> <div class=”position-absolute top-0 start-50 translate-middle-x”> <span></span> </div> <div class=”position-absolute top-0 end-0″> <span></span> </div> <div class=”position-absolute top-50 start-0 translate-middle-y”> <span></span> </div> <div class=”position-absolute top-50 start-50 translate-middle”> <span></span> </div> <div class=”position-absolute top-50 end-0 translate-middle-y”> <span></span> </div> <div class=”position-absolute bottom-0 start-0″> <span></span> </div> <div class=”position-absolute bottom-0 start-50 translate-middle-x”> <span></span> </div> <div class=”position-absolute bottom-0 end-0″> <span></span> </div> </div> </body> </html> Few more examples Some more examples are shown below, where .position class is used along with other utility classes provided by Bootstrap: Example You can edit and try running this code using the Edit & Run option. <!DOCTYPE html> <html lang=”en”> <head> <title>Bootstrap – Position</title> <meta charset=”UTF-8″> <meta http-equiv=”X-UA-Compatible” content=”IE=edge”> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> <link href=”https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css” rel=”stylesheet”> <script src=”https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js”></script> </head> <body> <div class=”d-flex p-5 gap-5″> <button type=”button” class=”btn btn-success position-relative”> Notifications<span class=”position-absolute top-0 start-100 translate-middle p-2 bg-danger border border-light rounded-circle”><span class=”visually-hidden”>unread messages</span></span> </button> <button type=”button” class=”btn btn-primary position-relative”> Inbox <span class=”position-absolute top-0 start-100 translate-middle badge rounded-pill bg-danger”> 99+ <span class=”visually-hidden”>unread messages</span> </span> </button> <button type=”button” class=”btn btn-warning position-relative”> Messages <span class=”position-absolute top-0 start-100 translate-middle badge border border-light

Bootstrap – Flex

Bootstrap – Flex ”; Previous Next This chapter discusses about the flex utilities. The .flex utility classes are helpful in quickly managing the layout, alignment and sizing of grid columns, navigation, components and much more. Enable flex behaviors Utilize display utilities to establish a flexbox container and convert immediate child elements into flex items, allowing for further customization of flex containers and items through additional flex properties. Let us see an example for a flex container and an inline flex container: Example You can edit and try running this code using the Edit & Run option. <!DOCTYPE html> <html lang=”en”> <head> <title>Bootstrap Flex</title> <meta charset=”UTF-8″> <meta http-equiv=”X-UA-Compatible” content=”IE=edge”> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> <link href=”https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css” rel=”stylesheet”> <script src=”https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js”></script> </head> <body> <div class=”container mt-3″> <h4>Flex utilities</h4> <div class=”d-flex p-4 bg-info”>A simple flexbox container!</div> <div class=”d-inline-flex p-4 bg-warning”>An inline flexbox container!</div> </body> </html> Variations that adapt to different screen sizes are also available for the classes .d-flex and .d-inline-flex. .d-flex .d-inline-flex .d-sm-flex .d-sm-inline-flex .d-md-flex .d-md-inline-flex .d-lg-flex .d-lg-inline-flex .d-xl-flex .d-xl-inline-flex .d-xxl-flex .d-xxl-inline-flex Direction Using the direction utilities, you can set the direction of flex items in a flex container. Following are the direction utilities provided by Bootstrap: .flex-row – to set a horizontal direction, which is also the browser default. .flex-row-reverse – to start the horizontal direction from the opposite side. .flex-column – to set a vertical direction. .flex-column-reverse – to start the vertical direction from the opposite side. Let us see an example for the direction utility classes: Example You can edit and try running this code using the Edit & Run option. <!DOCTYPE html> <html lang=”en”> <head> <title>Bootstrap Flex</title> <meta charset=”UTF-8″> <meta http-equiv=”X-UA-Compatible” content=”IE=edge”> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> <link href=”https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css” rel=”stylesheet”> <script src=”https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js”></script> </head> <body> <div class=”container mt-3″> <h4>Flex utilities – direction (row & column)</h4> <div class=”d-flex flex-row mb-4 bg-info border border-dark”> <div class=”p-3 border border-dark”>Row One</div> <div class=”p-3 border border-dark”>Row Two</div> <div class=”p-3 border border-dark”>Row Three</div> </div> <div class=”d-flex flex-row-reverse bg-warning border border-success”> <div class=”p-3 border border-success”>Row Four</div> <div class=”p-3 border border-success”>Row Five</div> <div class=”p-3 border border-success”>Row Six</div> </div> <div class=”d-flex flex-column mb-3 bg-danger-subtle bg-gradient border border-dark”> <div class=”p-3 border border-dark”>Column One</div> <div class=”p-3 border border-dark”>Column Two</div> <div class=”p-3 border border-dark”>Column Three</div> </div> <div class=”d-flex flex-column-reverse bg-light border border-dark”> <div class=”p-3 border border-dark”>Column Four</div> <div class=”p-3 border border-dark”>Column Five</div> <div class=”p-3 border border-dark”>Column Six</div> </div> </body> </html> Variations that adapt to different screen sizes are also available for the class .flex-direction: .flex-row .flex-row-reverse .flex-column .flex-column-reverse .flex-sm-row .flex-sm-row-reverse .flex-sm-column .flex-sm-column-reverse .flex-md-row .flex-md-row-reverse .flex-md-column .flex-md-column-reverse .flex-lg-row .flex-lg-row-reverse .flex-lg-column .flex-lg-column-reverse .flex-xl-row .flex-xl-row-reverse .flex-xl-column .flex-xl-column-reverse .flex-xxl-row .flex-xxl-row-reverse .flex-xxl-column .flex-xxl-column-reverse Justify content The .justify-content utility classes are used to change the alignment of flex items on the main axis, i.e. x -axis to start, and y-axis in case of flex-direction: column. The different options available are: start end center between around evenly Let us see an example for the justify content classes: Example You can edit and try running this code using the Edit & Run option. <!DOCTYPE html> <html lang=”en”> <head> <title>Bootstrap Flex</title> <meta charset=”UTF-8″> <meta http-equiv=”X-UA-Compatible” content=”IE=edge”> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> <link href=”https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css” rel=”stylesheet”> <script src=”https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js”></script> </head> <body> <div class=”container mt-3″> <h4>Flex utilities – Justify content</h4> <div class=”d-flex justify-content-start mb-4 bg-info border border-dark”> <div class=”p-3 border border-dark”>Row One</div> <div class=”p-3 border border-dark”>Row Two</div> <div class=”p-3 border border-dark”>Row Three</div> </div> <div class=”d-flex justify-content-end mb-4 bg-warning border border-success”> <div class=”p-3 border border-success”>Row Four</div> <div class=”p-3 border border-success”>Row Five</div> <div class=”p-3 border border-success”>Row Six</div> </div> <div class=”d-flex justify-content-center mb-4 bg-danger-subtle bg-gradient border border-dark”> <div class=”p-3 border border-dark”>Column One</div> <div class=”p-3 border border-dark”>Column Two</div> <div class=”p-3 border border-dark”>Column Three</div> </div> <div class=”d-flex justify-content-between mb-4 bg-light border border-dark”> <div class=”p-3 border border-dark”>Column Four</div> <div class=”p-3 border border-dark”>Column Five</div> <div class=”p-3 border border-dark”>Column Six</div> </div> <div class=”d-flex justify-content-around mb-4 bg-success-subtle bg-gradient border border-dark”> <div class=”p-3 border border-dark”>Column Four</div> <div class=”p-3 border border-dark”>Column Five</div> <div class=”p-3 border border-dark”>Column Six</div> </div> <div class=”d-flex justify-content-evenly mb-4 bg-primary-subtle bg-gradient border border-dark”> <div class=”p-3 border border-dark”>Column Four</div> <div class=”p-3 border border-dark”>Column Five</div> <div class=”p-3 border border-dark”>Column Six</div> </div> </div> </body> </html> Variations that adapt to different screen sizes are also available for the class .justify-content: .justify-content-start .justify-content-end .justify-content-center .justify-content-between .justify-content-around .justify-content-evenly .justify-content-sm-start .justify-content-sm-end .justify-content-sm-center .justify-content-sm-between .justify-content-sm-around .justify-content-sm-evenly .justify-content-md-start .justify-content-md-end .justify-content-md-center .justify-content-md-between .justify-content-md-around .justify-content-md-evenly .justify-content-lg-start .justify-content-lg-end .justify-content-lg-center .justify-content-lg-between .justify-content-lg-around .justify-content-lg-evenly .justify-content-xl-start .justify-content-xl-end .justify-content-xl-center .justify-content-xl-between .justify-content-xl-around .justify-content-xl-evenly .justify-content-xxl-start .justify-content-xxl-end .justify-content-xxl-center .justify-content-xxl-between .justify-content-xxl-around .justify-content-xxl-evenly Align items In order to change the alignment of flex items of a flexbox container, use the utility class align-items. The options available in Bootstrap are as follows: start end center baseline stretch (browser default) Let us see an example for the align items utility class: Example You can edit and try running this code using the Edit & Run option. <!DOCTYPE html> <html lang=”en”> <head> <title>Bootstrap Flex</title> <meta charset=”UTF-8″> <meta http-equiv=”X-UA-Compatible” content=”IE=edge”> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> <link href=”https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css” rel=”stylesheet”> <script src=”https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js”></script> </head> <body> <div class=”container mt-3″> <h4>Flex utilities – align items</h4> <div class=”d-flex align-items-start flex-row border bg-light mb-4″ style=”height:150px;”> <div class=”border border-dark p-2 text-bg-success”> Item 1 </div> <div class=”border border-dark p-2 text-bg-primary”> Item 2 </div> <div class=”border border-dark p-2 text-bg-danger”> Item 3 </div> </div> <div class=”d-flex

Bootstrap – Forms

Bootstrap – Forms ”; Previous Next This chapter will discuss about Bootstrap forms. A form facilitate user to enter data such as name, email address, password etc, which can then be sent to server for processing. Bootstrap provides classes to create a variety of forms with varied styles, layouts and custom components. Basic form Form controls in Bootstrap extend Rebooted form styles with classes. For consistent rendering across browsers and devices with customized display, use these classes . To use more recent input controls, such as email verification, number selection, and other features, be sure to use an appropriate type attribute on all inputs (e.g., email for email addresses or the number for numerical data). Following example demonstrates Boostrap”s basic form. Example You can edit and try running this code using Edit & Run option. <!DOCTYPE html> <html lang=”en”> <head> <title>Bootstrap – Form</title> <meta charset=”UTF-8″> <meta http-equiv=”X-UA-Compatible” content=”IE=edge”> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> <link href=”https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css” rel=”stylesheet”> <script src=”https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js”></script> </head> <body> <form> <div class=”mb-3″> <label for=” sampleInputEmail” class=”form-label”>Username</label> <input type=”email” class=”form-control” id=” sampleInputEmail” aria-describedby=”emailHelp”> </div> <div class=”mb-3″> <label for=”sampleInputPassword” class=”form-label”>Password</label> <input type=”password” class=”form-control” id=”sampleInputPassword”> </div> <div class=”mb-3 form-check”> <input type=”checkbox” class=”form-check-input” id=”sampleCheck”> <label class=”form-check-label” for=”sampleCheck”>Remember me</label> </div> <button type=”submit” class=”btn btn-primary”>Log in</button> </form> </body> </html> Disabled forms To prevent user interactions and make an input appear lighter, use the disabled boolean attribute. To disable all the controls in a <fieldset>, add the disabled attribute. The <input>, <select>, and <button> elements of native form controls contained within a fieldset <disabled> are all treated by browsers as disabled, preventing keyboard and mouse interactions with them. If form has custom button-like elements, such as <a class=”btn btn-*”>…</a>, they have pointer-events: none set, which means they are still focusable and keyboard-operable. To prevent them from receiving focus use tabindex=”-1″ and use aria-disabled=”disabled” to signal their state to assistive technologies. Example You can edit and try running this code using Edit & Run option. <!DOCTYPE html> <html lang=”en”> <head> <title>Bootstrap – Form</title> <meta charset=”UTF-8″> <meta http-equiv=”X-UA-Compatible” content=”IE=edge”> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> <link href=”https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css” rel=”stylesheet”> <script src=”https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js”></script> </head> <body> <form> <fieldset disabled> <div class=”mb-3″> <label for=”disabledEmailInput” class=”form-label”>Disabled Input</label> <input type=”text” id=”disabledEmailInput” class=”form-control” placeholder=”Email Id”> </div> <div class=”mb-3″> <label for=”disabledPasswordInput” class=”form-label”>Disabled Input</label> <select id=”disabledPasswordInput” class=”form-select”> <option>Password</option> </select> </div> <div class=”mb-3″> <div class=”form-check”> <input class=”form-check-input” type=”checkbox” id=”disabledcheckbox” disabled> <label class=”form-check-label” for=”disabledcheckbox”> Disabled Check Box </label> </div> </div> <button type=”submit” class=”btn btn-primary”>Disabled Button</button> </fieldset> </form> </body> </html> Accessibility Every form control has an appropriate accessible name for assistive technology users. Using label elements or descriptive text within <button>…</button> is the simplest method to achieve this. When a visible “label” or appropriate text content is not provided then use other approaches for accessible names, for example: Use the class .visually-hidden to hide the <label> elements. Use aria-labelledby to pointing an existing element that behaves as a <label>. Including a title attribute. Use aria-label to set the element accessible name. When none of these are available, for accessible name assistive technology use placeholder attribute as a fallback on <input> and <textarea> elements. Using visually hidden content will help assistive technology users, however certain users may still have issues with a lack of visible label text. Print Page Previous Next Advertisements ”;

Bootstrap – Color & background

Bootstrap – Color and background ”; Previous Next This chapter discusses about setting the background color with appropriate contrasting foreground or text color. These color and background helper classes combine the .text-* utilities and .bg-* utilities in one common class, namely .text-bg-*. In order to make the links legible, that have relatively light foreground color, use on a dark background. Example You can edit and try running this code using the Edit & Run option. <!DOCTYPE html> <html lang=”en”> <head> <title>Bootstrap Helper</title> <meta charset=”UTF-8″> <meta http-equiv=”X-UA-Compatible” content=”IE=edge”> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> <link href=”https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css” rel=”stylesheet”> <script src=”https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js”></script> </head> <body> <h4>Color and background utilities</h4> <br> <div class=”text-bg-primary p-3″>Primary background with contrasting text color</div> <div class=”text-bg-secondary p-3″>Secondary background with contrasting text color</div> <div class=”text-bg-success p-3″>Success background with contrasting text color</div> <div class=”text-bg-danger p-3″>Danger background with contrasting text color</div> <div class=”text-bg-warning p-3″>Warning background with contrasting text color</div> <div class=”text-bg-info p-3″>Info background with contrasting text color</div> <div class=”text-bg-light p-3″>Light background with contrasting text color</div> <div class=”text-bg-dark p-3″>Dark background with contrasting text color</div> </body> </html> Accessibility tip: Use of color to the progress bars just provides a visual indication, and this will not be helpful to users of assistive technologies like screen readers. Make sure that the meaning is clear from the content itself. Use alternative means to add clarity to the content using the .visually-hidden class. With components The color and background helper classes can be used in place of combined .text-* and .bg-* classes, such as on badges. In order to make the links legible, that have relatively light foreground color, use on a dark background. Example You can edit and try running this code using the Edit & Run option. <!DOCTYPE html> <html lang=”en”> <head> <title>Bootstrap Helper</title> <meta charset=”UTF-8″> <meta http-equiv=”X-UA-Compatible” content=”IE=edge”> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> <link href=”https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css” rel=”stylesheet”> <script src=”https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js”></script> </head> <body> <h4>Color and background utilities – badges</h4> <br> <span class=”badge text-bg-success”>Success</span> <span class=”badge text-bg-info”>Info</span> <span class=”badge text-bg-warning”>Warning</span> </body> </html> The color and background helper classes can be used in place of combined .text-* and .bg-* classes, such as on cards. In order to make the links legible, that have relatively light foreground color, use on a dark background. Example You can edit and try running this code using the Edit & Run option. <!DOCTYPE html> <html lang=”en”> <head> <title>Bootstrap Helper</title> <meta charset=”UTF-8″> <meta http-equiv=”X-UA-Compatible” content=”IE=edge”> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> <link href=”https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css” rel=”stylesheet”> <script src=”https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js”></script> </head> <body> <h4>Color and background utilities – cards</h4> <br> <div class=”card text-bg-info mb-3″ style=”max-width: 18rem;”> <div class=”card-header fw-bold”>Card Header</div> <div class=”card-body”> <p class=”card-text”>Card showing the text and background color classes used together.</p> </div> </div> <div class=”card text-bg-warning mb-3″ style=”max-width: 18rem;”> <div class=”card-header fw-bold”>Card Header</div> <div class=”card-body”> <p class=”card-text”>Card showing the text and background color classes used together.</p>s </div> </div> </body> </html> Print Page Previous Next Advertisements ”;

Bootstrap – Spacing

Bootstrap – Spacing ”; Previous Next This chapter discusses about the utility classes provided by Bootstrap for spacing. Bootstrap provides predefined range of responsive margin, padding and gap utility classes that can be used to modify the appearance of an element. These utility classes work for all types of breakpoints, such as: breakpoint size xs sm >=576px md >=768px lg >=992px xl >=1200px xxl >=1400px The naming format of these classes is as follows: breakpoint naming format xs {property}{sides}-{size} sm, md, lg, xl, xxl {property}{sides}-{breakpoint}-{size} where property can be one of the following: property value m margin p padding where sides can be one of the following: side value t margin-top/padding-top b margin-bottom/padding-bottom s margin-left/padding-left e margin-right/padding-right x margin-left and margin-right or padding-left and padding-right y margin-top and margin-bottom or padding-top and padding-bottom blank margin and padding on all four sides where size can be one of the following: size value 0 margin/padding – 0 1 margin/padding – 0.25rem 2 margin/padding – 0.5rem 3 margin/padding – 1rem 4 margin/padding – 1.5rem 5 margin/padding – 3rem auto margin – auto Note: More sizes can be added by adding entries to the $spacers Sass map variable. Let us see an example for margin utilities: Example You can edit and try running this code using the Edit & Run option. <!DOCTYPE html> <html> <head> <title>Bootstrap – Spacing</title> <meta charset=”UTF-8″> <meta http-equiv=”X-UA-Compatible” content=”IE=edge”> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> <link href=”https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css” rel=”stylesheet”> <script src=”https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js”></script> </head> <body> <div class=”container mt-3″> <h4 class=”display-4″>Spacing margin utilities</h4> <p><u>Set the spacing (margin) of an element with the {property}{sides}-{breakpoint}-{size} classes.</u></p> <div class=”mt-4 bg-info”>Only top margin (1.5rem)</div> <div class=”mb-5 bg-light”>Only bottom margin (1rem)</div> <div class=”ms-5 bg-warning”>Only left margin (3rem)</div> <div class=”me-5 bg-warning”>Only right margin (3rem)</div> <div class=”mx-5 text-bg-secondary”>Both left and right margins (3rem)</div> <div class=”my-5 bg-primary”>Both top and bottom margins (3rem)</div> </div> </body> </html> Let us see an example for padding utilities: Example You can edit and try running this code using the Edit & Run option. <!DOCTYPE html> <html> <head> <title>Bootstrap – Spacing</title> <meta charset=”UTF-8″> <meta http-equiv=”X-UA-Compatible” content=”IE=edge”> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> <link href=”https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css” rel=”stylesheet”> <script src=”https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js”></script> </head> <body> <div class=”container mt-3″> <h4 class=”display-4″>Spacing padding utilities</h4> <p><u>Set the spacing (padding) of an element with the {property){sides}-{breakpoint}-{size} classes.</u></p> <div class=”pt-4 bg-info”>Only top padding (1.5rem)</div> <div class=”pb-5 text-bg-success”>Only bottom padding (1rem)</div> <div class=”ps-5 bg-warning”>Only left padding (3rem)</div> <div class=”pe-5 text-bg-danger”>Only right padding (3rem)</div> <div class=”px-5 text-bg-secondary”>Both left and right padding (3rem)</div> <div class=”py-5 text-bg-primary”>Both top and bottom padding (3rem)</div> </div> </body> </html> Horizontal centering For horizontal centering fixed-width block level content, Bootstrap provides .mx-auto class. Let us see an example: Example You can edit and try running this code using the Edit & Run option. <!DOCTYPE html> <html> <head> <title>Bootstrap – Spacing</title> <meta charset=”UTF-8″> <meta http-equiv=”X-UA-Compatible” content=”IE=edge”> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> <link href=”https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css” rel=”stylesheet”> <script src=”https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js”></script> </head> <body> <div class=”container mt-3″> <h4 class=”display-5″>Horizontal centering</h4><br> <div class=”mx-auto p-2 text-bg-success” style=”width: 200px;”> Horizontally centered </div> </div> </body> </html> By default, negative values can be used with margin properties in CSS. The negative values cannot be used with padding. It is possible to enable the negative margins by setting the variable $enable-negative-margins to true. Gap utilities You can make use of gap utilities on the parent element, while using display: grid or display: flex. By default the gap utilities are responsive. It can hold the values for all the six sizes from the $spacers map (0-5). There is no .gap-auto class, as it is same as .gap-0. Let us see an example: Example You can edit and try running this code using the Edit & Run option. <!DOCTYPE html> <html> <head> <title>Bootstrap – Spacing</title> <meta charset=”UTF-8″> <meta http-equiv=”X-UA-Compatible” content=”IE=edge”> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> <link href=”https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css” rel=”stylesheet”> <script src=”https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js”></script> </head> <body> <div class=”container mt-3″> <h4 class=”display-6″> gap utility </h4> <h4>gap utility class <i>.gap-*</i></h4> <div class=”d-grid gap-0 p-3 border border-primary bg-light”> <div class=”p-2 bg-light border”> gap-0 </div> <div class=”p-2 bg-light border”> gap-0 </div> </div> <div class=”d-grid gap-1 p-3 border border-danger bg-primary-subtle”> <div class=”p-2 bg-light border”> gap-1 </div> <div class=”p-2 bg-light border”> gap-1 </div> </div> <div class=”d-grid gap-2 p-3 border border-success bg-danger-subtle”> <div class=”p-2 bg-light border”> gap-2 </div> <div class=”p-2 bg-light border”> gap-2 </div> </div> </div> </body> </html> row-gap In order to set the vertical space between children items in a specified container, use the utility class .row-gap. Let us see an example: Example You can edit and try running this code using the Edit & Run option. <!DOCTYPE html> <html> <head> <title>Bootstrap – Spacing</title> <meta charset=”UTF-8″> <meta http-equiv=”X-UA-Compatible” content=”IE=edge”> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> <link href=”https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css” rel=”stylesheet”> <script src=”https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js”></script> </head> <body> <div class=”container mt-3″> <h4 class=”display-6″> gap utility </h4> <h4>row gap utility class <i>.row-gap-*</i></h4> <div class=”d-grid gap-0 row-gap-4″> <div class=”p-2 border bg-primary”> row gap-4 </div> <div class=”p-2 border bg-info”> row gap-4 </div> <div class=”p-2 border bg-warning”> row gap-4 </div> <div class=”p-2 border bg-danger-subtle”> row