overflow:hidden可以将页面溢出内容隐藏起来

我只是一个虾纸丫 提交于 2020-01-19 23:43:19
<!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>


易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!