首页 > 其他分享 >前端010-overfloat

前端010-overfloat

时间:2022-11-19 16:23:44浏览次数:43  
标签:滚动条 auto 前端 overflow 010 overfloat hidden div

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>overfloat</title>
</head>
<body style="width: 980px;margin: 0 auto;">
<h3>overflow:如果图片的大小超过div的大小,div就会被撑开,此时用overfloat就会保证原有的大小。 hidden,auto</h3>
<h3>overflow:hidden 不出现滚动条,auto出现滚动条</h3>
<h3>还有一个解决div不被撑开的方法:直接在img标签上设置宽高</h3>
<div style="width: 200px;height: 200px;overflow: auto">
<img src="001.jpg"/>
</div>
<div style="width: 200px;height: 200px;overflow:hidden">
<img src="001.jpg"/>
</div>
<div >
<img src="001.jpg" style="width: 200px;height: 200px;"/>
</div>
</body>
</html>

标签:滚动条,auto,前端,overflow,010,overfloat,hidden,div
From: https://www.cnblogs.com/lfyxys/p/16906316.html

相关文章