DEV Community

vidhya murali
vidhya murali

Posted on

HTML,CSS Questions

Display Properties

CSS display property defines how an element is shown on the webpage.

Common Display Properties

  1. display: block

Element takes full width and starts on a new line.

Examples: div, h1,p

  1. display: inline

Element takes only content width.

Examples: span ,a, b

  1. display: inline-block

Combination of inline + block.

  1. display: none

Element completely disappears

*Box-Sizing Property *:

box-sizing defines how the total width and height of an element are calculated

  1. box-sizing: content-box (Default)

Width only applies to content area.

  1. box-sizing: border-box

Padding and border are included inside width

Top comments (0)