我将其尺寸设置为百分比. ie7,firefox& Chrome但不是Safari.它大大扭曲了形象!
我是否需要使用JavaScript才能正确显示图像?
提前致谢…
解决方法 有问题的代码:<img src="images/uftMap.jpg" border="0" wIDth="95%" height="95%" alt="Universal fitness & Training on Google maps" name="Universal fitness & Training on Google maps">
删除height属性,浏览器将按比例缩放它.
然而,将百分比放在高度和宽度属性中并不是严格的复制.从HTML5 spec
height = non-negative integer:
The height of the image,in CSS pixels.wIDth = non-negative integer:
The wIDth of the image,in CSS pixels.
如果您设置内联样式而不是样式表,那么使用样式属性会更好:
<img src="images/uftMap.jpg" border="0" alt="Universal fitness & Training on Google maps" name="Universal fitness & Training on Google maps">总结
以上是内存溢出为你收集整理的在百分比中设置的HTML / CSS图像尺寸在Safari中无法正确显示全部内容,希望文章能够帮你解决在百分比中设置的HTML / CSS图像尺寸在Safari中无法正确显示所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)