CSS3 overflow-y 属性
作用: 裁剪div元素中内容的左右边缘溢出(如果内容有溢出的话)
JavaScript语法: object.style.overflowY="scroll"
参数:
visible: 不裁剪内容,可能会显示在内容框之外。
hidden: 裁剪内容 - 不提供滚动机制。
scroll: 裁剪内容 - 提供滚动机制。
auto: 如果溢出框,则应该提供滚动机制。
no-display: 如果内容不适合内容框,则删除整个框。
no-content: 如果内容不适合内容框,则隐藏整个内容。
实例:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>test</title>
<style>
div {
width:110px;
height:110px;
border:thin solid black;
overflow-x:hidden;
overflow-y:hidden;
}
</style>
</head>
<body>
<div>
<p style="width:140px">
In my younger and more vulnerable years my father gave me some advice that I've been turning over in my mind ever since.
'Whenever you feel like criticizing anyone,' he told me, 'just remember that all the people in this world haven't had the advantages that you've had.'
</p>
</div>
<p>Overflow-x指定是否要剪辑的左/右边缘的内容.</p>
<p>Overflow-y指定是否要剪辑的顶部/底部边缘的内容</p>
</body>
</html>