About Lesson
CSS Display:
The display property in CSS controls the type of box model used by an element. It specifies how the element should be displayed on the web page. CSS provides several display property values including:
- Block: This value is used to display an element as a block-level element that takes up the entire width of its parent container. Block-level elements create a new line after the element.
- Inline: This value is used to display an element as an inline-level element that does not create a new line after the element. Inline-level elements only take up as much width as necessary to display their contents.
- Inline-block: This value is used to display an element as an inline-level block container. Inline-block elements behave like inline-level elements, but they can have a width, height, margin, and padding.
- None: This value is used to hide an element and remove it from the layout of the web page.