What does display:none mean?

hzc
Release: 2022-04-01 18:08:54
Original
58390 people have browsed it

"display:none" means to set the element to be invisible and not even generate a box model. It is generally used for hidden elements that do not take up space. The display attribute specifies the type of box that the element should generate. When its value is "none", it can be specified that the element does not generate a box. Hiding the element can be understood as deleting the element from the page.

What does display:none mean?

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

display:none means:

"display:none" means that the set element is invisible and connected The box model is not generated and is generally used for hidden elements that do not take up space.

The "display:none" style truly hides the element according to the meaning of the word.

displayThe attribute specifies the type of box that the element should generate. When its value is "none", it can be specified that the element does not generate a box.

Using the display attribute, hidden elements do not occupy any space. Not only that, once display is set to none, any direct user interaction on the element will not be effective.

Use "display:none" to hide the element without occupying space, so dynamically changing this attribute will cause rearrangement (change the page layout), which can be understood as in the page It is the same as deleting the element; it will not be inherited by descendants, but its descendants will not be displayed. After all, they are all hidden together.

Let’s take a look at the usage of display:none.

    
需要隐藏的区域
Copy after login

If the display:none attribute value is set, the effect will be as shown in the figure below: the area that needs to be hidden will be hidden.

What does display:none mean?

What does display:none mean?

Recommended tutorial: "HTML Tutorial"

The above is the detailed content of What does display:none mean?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!