css样式问题 设置图片的最大宽度 需要兼容
网上查了一下这么写
1
#infos p img{
max-width: 200px;
height:auto;
width:expression(this.width > 200 ? "200px" : this.width);
}
2
#infos p img{
width: auto;
height: auto;
max-width: 705px;
width: expression(document.body.clientWidth>705?"705px":"auto");
border:1px solid red;
}
上面两种IE 6 不兼容 IE7/8 没事
IE6 有时打开页面是好的,但是已刷新就变成原来的大小了, 还有就是代开是小图片。
请各位大牛指点 非常感谢。 css样式或是js控制
<div style="width: 760px; height: auto; border: 0px solid red;" id="infos">
<p><img alt="" src="/UploadFiles/xiantang001.jpg" /></p>
</div>