显示不同的overflow-x属性值:
div.ex1 {
overflow-x: scroll;
}
div.ex2 {
overflow-x: hidden;
}
div.ex3 {
overflow-x: auto;
}
div.ex4 {
overflow-x: visible;
}
亲自试一试 »
这个overflow-x
属性指定当块级元素在左右边缘溢出时是否裁剪内容、添加滚动条或显示块级元素的溢出内容。
提示:使用溢出-y属性来确定顶部和底部边缘的剪切。
表中的数字指定完全支持该属性的第一个浏览器版本。
后跟 -ms- 的数字指定使用前缀的第一个版本。
Property | |||||
---|---|---|---|---|---|
overflow-x | 4.0 | 9.0 8.0 -ms- |
3.5 | 3.0 | 9.5 |
overflow-x: visible|hidden|scroll|auto|initial|inherit;
Value | Description | Demo |
---|---|---|
visible | The content is not clipped, and it may be rendered outside the left and right edges. This is default | Demo ❯ |
hidden | The content is clipped - and no scrolling mechanism is provided | Demo ❯ |
scroll | The content is clipped and a scrolling mechanism is provided | Demo ❯ |
auto | Should cause a scrolling mechanism to be provided for overflowing boxes | Demo ❯ |
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 参考:溢出X属性
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!