display: Make the paragraph appear within the line Box
visibility: Attribute specifies whether the element is visible.
2. display attribute
value
description
none
This element will not be displayed.
block
#This element will be displayed as a block-level element, with line breaks before and after this element.
inline
Default. This element will be displayed as an inline element with no line breaks before or after the element.
inline-block
Inline block element. (New value in CSS2.1)
list-item
This element will be displayed as a list.
run-in
This element will appear as a block-level element or an inline element, depending on the context.
compact
The value compact was present in CSS, but was removed from CSS2.1 due to lack of widespread support .
marker
There is a value marker in CSS, but it has been removed from CSS2.1 due to lack of widespread support. .
##table
This element will be displayed as a block-level table (similar to
), with line breaks before and after the table.
##inline-table
This element will be displayed as an inline table (similar to
), there are no line breaks before and after the table.
table-row-group
This element will be displayed as a group of one or more rows (similar to
).
table-header-group
This element will be displayed as a group of one or more rows (similar to
).
table-footer-group
This element will be displayed as a group of one or more rows (similar to
).
table-row
This element will be displayed as a table row (similar to
).
table-column-group
This element will be displayed as a group of one or more columns (similar to
).
##table-column
This element will be displayed as a column of cells (similar to
)
table-cell
This element will be displayed as a table cell (similar to
and
)
##table-caption
This element will be displayed as a table title (similar to
)
inherit
Specifies that the value of the display attribute should be inherited from the parent element.
3. visibility attribute
##value
Description
visible
Default value. The element is visible.
hidden
The element is invisible.
collapse
When used in a table element, this value deletes a row or column, but it does not Will affect the layout of the table. The space occupied by a row or column is freed for other content. If this value is used on another element, it will be rendered as "hidden".
inherit
Specifies that the value of the visibility attribute should be inherited from the parent element.
4. "display:none" and "visibility:hidden"
(1) display:none: After the element is hidden, it does not occupy its original position
(2) visibility: hidden: After the element is hidden, it occupies its original position
The above is the detailed content of Hide and show CSS elements. For more information, please follow other related articles on the PHP Chinese 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