Horje
What is use of d-none and d-block Classes in Bootstrap?

The .d-none and .d-block classes in Bootstrap are used for controlling the visibility of elements. .d-none hides the element by default, while .d-block displays it as a block-level element.

Syntax:

<div class="d-none">Hidden content</div>
<div class="d-block">Visible content</div>

Explanation: (.d-none) class sets the element’s display property to ‘none’, making it invisible on the webpage. Conversely,
.d-block class sets the display property to ‘block’, rendering the element as a block-level element, causing it to appear on the webpage. These classes provide a simple way to toggle the visibility of elements in Bootstrap-based projects.

Features:

  • .d-none hides the element by setting its display property to ‘none’.
  • .d-block displays the element as a block-level element, making it visible.
  • These classes are part of Bootstrap’s utility classes for controlling visibility.
  • They offer a straightforward way to toggle the visibility of elements on the webpage.

Ref: /archive/bootstrap-5-display/




Reffered: https://www.geeksforgeeks.org


Bootstrap

Related
What is use of text-center Class in Bootstrap ? What is use of text-center Class in Bootstrap ?
What is use of the table-striped Class in Bootstrap ? What is use of the table-striped Class in Bootstrap ?
What is the use of justify-content Class in Bootstrap ? What is the use of justify-content Class in Bootstrap ?
How to Create a Three-Column Layout in Bootstrap? How to Create a Three-Column Layout in Bootstrap?
How to create a Responsive Image in Bootstrap? How to create a Responsive Image in Bootstrap?

Type:
Geek
Category:
Coding
Sub Category:
Tutorial
Uploaded by:
Admin
Views:
11