Mid JavaScript

What does display: none do?

It completely hides the element — it’s not visible and doesn’t take up space in the layout.

Example:

.hidden { display: none; }

Key Takeaway:

display: none removes the element from the document flow.

More from JavaScript Tutorial

All questions for this course