我想要的是图像随着浏览器窗口的缩放而缩小。将它作为背景图像是更好的解决方案吗?我怎样才能在一个div响应的图像?
#home-feature5 {
height:618px;
width:1210px;
position:relative;
}
.photo {
bottom: 37px;
position: absolute;
z-index: 1;
left: 20px;
}
.photo img {
max-width:100%;
height:auto;
}
.bg {
background-color:#f88b5c;
width:100%;
height:95px;
bottom:0;
left:0;
position:absolute;
}
小提琴:http://jsfiddle.net/9LLr7m6w/
您需要使用背景'background-size:cover;' – 2014-09-28 20:02:05