下面有更多 "亲自试一试" 示例。
这个visibility
属性指定元素是否可见。
提示:隐藏元素占用页面空间。使用展示属性来隐藏和删除文档布局中的元素!
表中的数字指定完全支持该属性的第一个浏览器版本。
Property | |||||
---|---|---|---|---|---|
visibility | 1.0 | 4.0 | 1.0 | 1.0 | 4.0 |
visibility: visible|hidden|collapse|initial|inherit;
Value | Description | Demo |
---|---|---|
visible | Default value. The element is visible | Demo ❯ |
hidden | The element is hidden (but still takes up space) | Demo ❯ |
collapse | Only for table rows (<tr>), row groups (<tbody>), columns (<col>), column groups (<colgroup>). 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 collapse is used on other elements, it renders as "hidden" |
|
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
CSS教程:CSS 显示和可见性
HTML DOM 参考:可见性属性
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!