我想插入一个特定的图像,该图像将覆盖它所包含的父宽度并拉伸到浏览器的宽度。图像也应该是响应式的。我不知道该怎么做。这甚至可能吗?预先感谢您的帮助!
html代码:
<div id="wrapper">
<img id="pic" src="http://static.stuff.co.nz/1357440924/872/8147872.jpg" />
<p>This is a test</p>
</div>
CSS代码:
#wrapper {
width: 300px;
margin: 0 auto;
}
#pic {
width: 100%;
}
Jsfiddle 链接在这里:http: //jsfiddle.net/9Ttyh/