<!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>
来源:https://www.cnblogs.com/startl/p/12215893.html