Bootstrap – Display


Bootstrap – Display



”;


This chapter discusses about the display property of the Bootstrap.

In Bootstrap, the display property is used to control the visibility and behavior of elements. It allows you to define how an element should be rendered and positioned within the document layout.


Notation

  • Utility classes that are applicable to all breakpoints, ranging from xs to xxl, do not have any abbreviation for breakpoints.

  • These classes are implemented from a min-width: 0; and beyond and not restricted by media query.

  • The remaining breakpoints do contain an abbreviation for the breakpoint.


Following format is used in naming the display classes:

  • .d-{value} for xs, such as .d-none.

  • .d-{breakpoint}-{value} for sm, md, lg, xl and xxl, such as .d-lg-none sets display: none; on lg, xl, and xxl screens.


{value} can be one of the following:

  • none

  • inline

  • inline-block

  • block

  • grid

  • inline-grid

  • table

  • table-cell

  • table-row

  • flex

  • inline-flex

Some of the values display property take, are as follows:

  • .d-none: This value hides the element completely, making it invisible and not taking up any space in the layout.

  • .d-inline: This value makes the element behave like an inline element, allowing other elements to be displayed alongside it on the same line.

  • .d-block: This value makes the element behave like a block-level element, causing it to start on a new line and take up the full available width.

  • .d-inline-block: This value combines the characteristics of both inline and block elements. The element is displayed inline, allowing other elements to be displayed alongside it.

Let us see an example of .d-inline: