The display property in Bootstrap is used to set an element’s display property. The utilities such as block, inline etc are to set the element’s display property.
The display property classes of bootstrap help to directly set the CSS display property for an element.
The available classes are:
- .d-block: This class when used with an element, sets it display property to block. Using this class with an element is equivalent to the below styling:
style = "display: block;"
- .d-inline: This class when used with an element, sets it display property to inline. Using this class with an element is equivalent to the below styling:
style = "display: inline;"
- .d-inline-block: This class when used with an element, sets it display property to inline-block. Using this class with an element is equivalent to the below styling:
style = "display: inline-block;"
- <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
Below examples illustrate the use of the display properties classes of bootstrap:
- What is the difference between display: inline and display: inline-block in CSS?
- How to display multiple horizontal images in Bootstrap card ?
- How to display bootstrap carousel with three post in each slide?
- How to change column to row on small display in Bootstrap 4 ?
- How to Display Validation Message for Radio Buttons with Inline Images using Bootstrap 4 ?
- How to Create a Bootstrap Spinner and Display on Screen till the data from the API loads ?
- Include Bootstrap in AngularJS using ng-bootstrap
- Difference between bootstrap.css and bootstrap-theme.css
- Difference Between Bootstrap 3 and Bootstrap 4
- Difference between Bootstrap 4 and Bootstrap 5
- CSS | Display property
- HTML | DOM Style display Property
- CSS | font-display property
- How to set the offset property for ScrollSpy in Bootstrap ?
- Responsive images in Bootstrap with Examples
- Visibility of elements in bootstrap with Examples
- Vertical alignment in Bootstrap with Examples
- List group in bootstrap with examples
- Containers in Bootstrap with examples
- Bootstrap | Close Icon for dismissing content with Examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.