Display Property in Bootstrap with Examples Last Updated : 25 Apr, 2024 Comments Improve Suggest changes Like Article Like Report In Bootstrap, the display property controls the layout behavior of elements. Bootstrap provides utility classes like d-none (hide), d-block (display as block), d-inline (display as inline), etc., for responsive display manipulation. The available classes are: Class NameDescription.d-blockSets the display property of an element to block, making it a block-level element..d-inlineSets the display property of an element to inline, allowing it to flow inline with text..d-inline-blockSets the display property of an element to inline-block, combining inline and block..d-flexDisplays content in a box format using the Flexbox layout model..d-gridDisplays content in a grid format using the CSS grid layout model.Syntax: <div class="d-inline"> Inline </div> // for inline display<div class="d-block"> Block </div> // for block display<div class="d-inline-block"> Inline Block </div> // for inline-block display<div class="d-flex"> flex box </div> // for flex-box display<div class="d-grid"> grid </div> // for grid displayExamples of Bootstrap Display PropertyExample 1: In this example we uses Bootstrap's d-block class to display two divs as block elements with a blue background color. html <!DOCTYPE html> <html> <head> <style> div { font-size: 30px; } </style> <!-- Include Bootstrap CSS and JS --> <link rel="stylesheet" href= "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" /> <script src= "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"> </script> <script src= "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"> </script> <title>Webpage</title> </head> <body> <div class="d-block bg-primary"> GeeksforGeeks </div> <div class="d-block bg-primary"> GeeksforGeeks </div> </body> </html> Output: Example 2: In this example we use Bootstrap's d-inline class to display two divs as inline elements with a green background color. html <!DOCTYPE html> <html> <head> <style> div { font-size: 30px; } </style> <!-- Add Bootstrap CSS and JS --> <link rel="stylesheet" href= "https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity= "sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous" /> <script src= "https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity= "sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script> <script src= "https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity= "sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script> <script src= "https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity= "sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script> <title>Webpage</title> </head> <body> <div class="d-inline bg-success"> GeeksforGeeks </div> <div class="d-inline bg-success"> GeeksforGeeks </div> </body> </html> Output: Example 3: In this example we use Bootstrap's d-inline-block class to display two divs as inline-block elements with a yellow background color. html <!DOCTYPE html> <html> <head> <style> body { font-size: 75px; } </style> <!-- Add Bootstrap CSS and JS --> <link rel="stylesheet" href= "https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity= "sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous" /> <script src= "https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity= "sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script> <script src= "https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity= "sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script> <script src= "https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity= "sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script> <title>Webpage</title> </head> <body> <div class="d-inline-block bg-warning"> GeeksforGeeks </div> <div class="d-inline-block bg-warning"> GeeksforGeeks </div> </body> </html> Output: Comment More infoAdvertise with us C chaitanyashah707 Follow Improve Article Tags : Web Technologies CSS Bootstrap Similar Reads Bootstrap Carousel Bootstrap Carousel enables slideshow functionality for images or content. Easily customizable with CSS and JavaScript. Supports responsive design and touch gestures, enhancing user experience in web development projects. It can be included in your webpage using "bootstrap.js" or "bootstrap.min.js". 4 min read Bootstrap Cards A card is a flexible and extensible content container. It includes options for headers and footers, a wide variety of content, contextual background colors, and powerful display options. It replaces the use of panels, wells and thumbnails. All of it can be used in a single container called card . Ba 2 min read Bootstrap | Badges and Breadcrumbs Badges: Badges are numbers associated with the link to indicate the number of items associated with the link. The notification number is seen when logged in to a particular website and tells the numbers of news or notifications to see by clicking it. Example: HTML <!DOCTYPE html> <html> 4 min read Clearfix in Bootstrap One of the major problems with the structure of HTML is that if you have a child div inside parent div, the child div automatically flows around the parent div. The solution to this problem is using clear property of CSS. Bootstrap allows us to use a class named clearfix which is used to clear the f 2 min read Image Replacement in Bootstrap using text-hide Class Bootstrap allows us to replace the text with background image for any text element like paragraph element, heading element etc. With the use of .text-hide class, we can replace an elementâs content with a background image. Syntax: <element class = "text-hide" style = "background-image: url('Speci 1 min read Typography in Bootstrap Bootstrap Typography provides a standardized and flexible approach to text styling, offering various classes for headings, paragraphs, and inline text elements. It ensures consistent typography across different devices and screen sizes, enhancing readability and aesthetics. Typography can be used to 2 min read Popovers in bootstrap with examples A Bootstrap Popover is an attribute in bootstrap that can be used to make any website look more dynamic. Popovers are generally used to display additional information about any element and are displayed with a click of a mouse pointer over that element. In the popover, if you click on any element th 3 min read Bootstrap | Spinners Set-2 Bootstrap provides us with various classes for creating different styles of the spinner to indicate the loading state. We can also modify the appearance, size, and placement of the spinners with the classes provided by Bootstrap. Buttons with border spinner: We can place the border spinner within th 4 min read Bootstrap | Spinners Set-1 Bootstrap provides us with various classes for creating different styles of the spinner to indicate the loading state. We can also modify the appearance, size, and placement of the spinners with the classes provided by Bootstrap. Types of Spinners: Border spinner: We can create a lightweight bordere 4 min read Differences between Bootstrap and JQuery UI Bootstrap: Bootstrap is a framework for front-end web development.it makes web development faster and easier. It contains HTML and CSS based design templates for various responsive front-end designing, as well as optional JavaScript plugins. JQuery UI: JQuery UI is a collection of GUI widgets and th 3 min read Like