Home >Web Front-end >HTML Tutorial >Detailed introduction to showing and hiding divs

Detailed introduction to showing and hiding divs

高洛峰
高洛峰Original
2017-03-20 16:13:141249browse

visibilityHidden objects also retain the physical space occupied by the object when it is displayed, while display does not retain it. You can save the following code to see the effect:
Specific steps:
Code example:



←Object whose SS attribute is visibility:hidden




←Objects whose SS attribute is display:none


Special Tips
Use the visibility attribute to control the hidden object and still occupy the position when it is displayed, while display No.

Special Note

The display attribute sets the display mode of the element. The corresponding script feature is display. The optional values ​​are none, block and inline. The description of each value is as follows:
none Hidden element , does not preserve the space when the element is displayed.
Display elements in block mode.
inline Displays elements inline.
inline-block objects appear as inline elements, but all child objects appear as block elements. Adjacent inline elements will appear on the same line, spaces are allowed.
list-item displays block elements as list objects and can add item punctuation. (Requires IE6.0+ support)
table-header-group displays the element as a table header group, equivalent to the tHead element.
table-footer-group displays the element as a table footer group, equivalent to the tFoot element.
The visibility attribute sets whether to display the element. The corresponding script feature is visibility. The optional values ​​are inherit, hidden and visible. The description of each value is as follows:
inherit inherits the visibility attribute setting of the parent element.
hidden Hides the element but retains the space it occupies.
visible Display element (default value).

The above is the detailed content of Detailed introduction to showing and hiding divs. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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