B.32. display
In HTML, there are different types of elements. div and blockquote, for example, are both block elements, while strong and em are both inline elements. For each type of element, a browser supports a "display mode". All block elements are essentially displayed the same way, just with varying margins, padding, borders, etc. by default.
The display property lets you set the "display mode" for an element. For example, you can set a hyperlink (a) to be displayed as a block instead of inline text.
The most common use for the display property is to show and hide portions of an HTML document. Setting display to none causes the element not only to be hidden (as with the visibility property), but not to occupy any space on the page either. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access