本章要點: 這個屬性經常用,但是我們要找出他的特點:visibility 屬性設置為 invisible 時,會占頁面空間但是 display 屬性不會占據空間。
轉自: http://www.w3pop.com/learn/view/doc/pr_class_visibility/
The visibility property sets if an element should be visible or invisible.
visibility屬性可設置元素為可見還是不可見
Note: Invisible elements takes up space on the page. Use the "display" property to create invisible elements that do not take up space.
注意:不可見的元素會占據頁面的空間。可以使用"display"屬性來讓不可見的元素同時不占據頁面的空間
Note: This property is used with scripts to create Dynamic HTML.
注意:這個屬性經常在建立動態HTML的時候用到
Inherited: No
繼承性:無
Example舉例
p { visibility: visible } |
Possible Values
可能用到的值
Value | 描述 |
---|---|
visible | The element is visible 元素可見 |
hidden | The element is invisible 元素不可見 |
collapse | When used in table elements, this value removes a row or column, but it does not affect the table layout. The space taken up by the row or column will be available for other content. If this value is used on other elements, it renders as "hidden" 當在表格元素中使用的時候,這個值可以移除一行或是一列,但它不會影響到表格的布局。被行或列所占據的空間對其他內容來說依然是有效的。如果這個值用到別的元素上它所反饋的效果就跟"hidden"一樣。 |