HTML DOM display 属性
2010-11-27 13:25
253 查看
定义和用法
display 属性设置元素如何显示。语法:
Object.style.display=value
Possible Values
值 | 描述 |
---|---|
none | 此元素不会被显示。 |
block | 此元素将显示为块级元素,此元素前后会带有换行符。 |
inline | 默认。此元素会被显示为内联元素,元素前后没有换行符。 |
list-item | 此元素会作为列表显示。 |
run-in | 此元素会根据上下文作为块级元素或内联元素显示。 |
compact | 此元素会根据上下文作为块级元素或内联元素显示。 |
marker | |
table | 此元素会作为块级表格来显示(类似 <table>),表格前后带有换行符。 |
inline-table | 此元素会作为内联表格来显示(类似 <table>),表格前后没有换行符。 |
table-row-group | 此元素会作为一个或多个行的分组来显示(类似 <tbody>)。 |
table-header-group | 此元素会作为一个或多个行的分组来显示(类似 <thead>)。 |
table-footer-group | 此元素会作为一个或多个行的分组来显示(类似 <tfoot>)。 |
table-row | 此元素会作为一个表格行显示(类似 <tr>)。 |
table-column-group | 此元素会作为一个或多个列的分组来显示(类似 <colgroup>)。 |
table-column | 此元素会作为一个单元格列显示(类似 <col>) |
table-cell | 此元素会作为一个表格单元格显示(类似 <td> 和 <th>) |
table-caption | 此元素会作为一个表格标题显示(类似 <caption>) |
实例
本例设置不显示元素:<html> <head> <script type="text/javascript"> function removeElement() { [code]document.getElementById("p1").style.display="none";
}
</script>
</head>
<body>
<h1>Hello</h1>
<p id="p1">This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.</p>
<input type="button" onclick="removeElement()"
value="Do not display paragraph" />
</body>
</html>[/code]
相关文章推荐
- HTML DOM display 属性
- HTML DOM display 属性
- HTML DOM display 属性
- HTML DOM display 属性
- HTML DOM status 属性
- 黄聪:PHP使用Simple_HTML_DOM遍历、过滤及保留指定属性
- HTML 5 Audio/Video DOM buffered 属性
- 动态创建html内容时所用的W3C DOM属性和方法
- HTML DOM nodeType 属性
- DOM属性和HTML属性的区别
- HTML DOM border 属性
- 动态创建html内容时所用的W3C DOM属性和方法
- 浏览器加载渲染HTML、DOM、CSS、 javascript、image、flash、iframe、src属性等资源的顺序总结
- html标签属性(attribute)和dom元素的属性(property)
- DOM对象属性(property)与HTML标签特性(attribute)
- HTML DOM element.nextElementSibling属性
- 浏览器加载渲染HTML、DOM、CSS、 JAVASCRIPT、IMAGE、FLASH、IFRAME、SRC属性等资源的顺序总结
- js-dom-动态创建html标签时,name属性的初始化问题
- HTML DOM readyState 属性
- HTML DOM defaultValue 属性