[英]How to make an image to fit the whole container width?
I'm trying to make my image to fit the whole container width. 我正在尝试使我的图像适合整个容器的宽度。
I've tried : 我试过了 :
width="100%"
给我的图片width="100%"
100%
将我的图片放在宽度为100%
的div中 None of those work. 这些都不起作用。
<div class="container" style="background-color:gray;">
<div width="100%">
<img width="100%" src="http://s6.postimg.org/7ic0egypt/report_nav.png">
</div>
</div
此处将其添加到您的CSS中,默认情况下,正文的边距为8px。
body{margin: 0px;}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.