CSS Display Property

The display property in CSS is used to specify the type of box used for an HTML element, influencing how it behaves in terms of layout and rendering on the web page.


Common display Property Values

  • block : Renders the element as a block-level element, taking up the full width available and starting on a new line.

  • inline : Renders the element as an inline-level element, allowing elements to flow within a line without starting on a new line.

  • inline-block : Similar to inline, but the element behaves like a block-level element regarding layout and styling while still flowing inline.

  • none : Hides the element from the layout entirely. The element and its space are not rendered.

  • flex : Establishes a flex container, allowing the use of Flexbox properties to arrange and manage child elements.