0
点赞
收藏
分享

微信扫一扫

img铺满div

q松_松q 2023-01-15 阅读 102


参考文章:​​http://www.wqcms.com/html/c31/2012-02/2331.html​​


<html>
<head>
<title>test</title>
</head>

<style type="text/css">
#divMain{
border: red solid 1px;
width:600px;
height: 400px;
padding:0px;
}
#divMain img{
border: green solid 1px;
width:100%; /* ... */
height:100%; /* ... */
display:block; /* ... */
}
</style>

<body>
<div id="divMain">
<img src="https://ss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/img/logo/bd_logo1_31bdc765.png"/>
</div>
</body>
</html>











举报

相关推荐

0 条评论