我目前面临的问题是当我尝试根据不同的分辨率调整图像大小时。输出我尽量做到像:http://jaxboxtech.com如何根据窗口自动调整图像大小
下面是我的代码:
#container{
width: 100%;
}
#img{
background: transparent center no-repeat url('image.png');
width: 100%;
height: 100%;
max-height: 850px;
background-size:cover;
}
<html>
<body>
<div>
<button>Efficiency</button>
<button>Power Metering</button>
</div>
<div id="img">
<img src='image.png' alt="" />
</div>
</body>
</html>
不幸的是它可以基于浏览器没有自动调整。请提醒我这部分代码错误地做了。非常感谢你。
哪个图片,您在html中定义的图片或您在div上设置为背景图片的图片?此外,还有一个流浪的''标签没有匹配的开标签。 –
@lamelemon,1是错误我纠正它。 – goh6319