HTML DOM overflow 属性
2016-02-22 09:27
429 查看
HTML DOM overflow 属性
HTML DOM Style 对象
定义和用法
overflow 属性规定如何处理如何处理不符合元素框的内容。语法:
Object.style.overflow=visible|hidden|scroll|auto
可能的值
值 | 描述 |
---|---|
visible | 内容不会被修剪,会呈现在元素框之外。 |
hidden | 内容会被修剪,但是浏览器不会显示供查看内容的滚动条。 |
scroll | 内容会被修剪,但是浏览器会显示滚动条以便查看其余的内容。 |
auto | 由浏览器决定如何显示。如果需要,则显示滚动条。 |
实例
本例使用 overflow 来显示溢出元素框的内容:<html> <head> <style type="text/css"> div { border:thin solid green; width:100px; height:100px; } </style> <script type="text/javascript"> function hideOverflow() { [code]document.getElementById("div1").style.overflow="hidden";
}
</script>
</head>
<body>
<div id="div1">
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.
</div>
<br />
<input type="button" onclick="hideOverflow()"
value="Hide overflow" />
</body>
</html>[/code]
TIY
overflow - 隐藏内容溢出
相关文章推荐
- html:打开新的页面
- html中的实体字符
- tjkd-html
- Chap 07 HTML建立超链接
- Chap 08 HTML添加多媒体
- HTML基础--认识基础结构
- HTML之零散知识点记录-1
- html基础研究(六)-通过标签子标签开与关、属性、内容以及嵌套来了解段落元素
- html的meta总结,html标签中meta属性使用介绍
- django中怎样生成非HTML格式的内容。
- html基础研究(五)-html段落元素研究
- C#将Word,Excel与Html,PDF互转
- HTML 事件(二) 事件的注册与注销
- 手机版同步html几点注意使用
- html基础研究(二)-html基础
- div实现拖拽效果,宽度发生变化
- 浏览器加载和渲染html的顺序
- html基础研究(一)-文本格式化标签研究
- Chap 06 HTML使用表格
- [FMS]FMS的allowedHTMLdomains.txt设定限制域名访问流媒体视频