overflow:hidden可以將頁面溢出內容隱藏起來


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Title</title>
<meta lang="utf8">
<div1>
<style>
.div1{
background-color: #1ecc86;
height:100px;
overflow: auto;
/*overflow: scroll;scroll有下拉滾動條*/

}
</style>
</div1>
</head>
<body>
<!--此時由於設置的高度有限,其余部分溢出,加入了overflow:auto,或者overflow:scroll(scroll有下拉滾動條)則會將溢出部分隱藏起來作為一個滾動條可以下拉查看-->
<div class="div1">
<h1>star</h1>
<h1>star</h1>
<h1>star</h1>
<h1>star</h1>
<h1>star</h1>
<h1>star</h1>
<h1>star</h1>
<h1>star</h1>
<h1>star</h1>
<h1>star</h1>
<h1>star</h1>
<h1>star</h1>
<h1>star</h1>
<img src="1.jpg">
</div>

</body>
</html>

 
         
         
       


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM