display: Make the paragraph appear within the line Box
visibility: Attribute specifies whether the element is visible.
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.).).).).).
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 position5, Exampleh1{ visibility: hidden;//隐藏占用元素空间 display: none;//隐藏不占用空间 } p{ display: inline;//改变为内联元素 } h2{ display: block;//改变块级元素 }
Copy after login
Related recommendations: Detailed explanation of CSS elements A simple way to center the layout
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!
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 Articles by Author
Latest Issues
Related Topics
More>
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
|