<html>
<head>
<style type="text/css">
div
{
border:1px solid red;
width:100px;
height:100px;
}
</style>
<script>
function displayResult()
{
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" οnclick="displayResult()" value="Hide overflow">
</body>
</html>
演示网址:
http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_style_overflow
style.overflow=hidden的一个很好的例子
最新推荐文章于 2023-09-07 18:03:04 发布