【发布时间】:2012-10-11 01:51:38
【问题描述】:
我正在处理图像,但遇到了纵横比问题。
<img src="big_image.jpg" width="900" height="600" alt="" />
如您所见,height 和 width 已指定。我为图片添加了 CSS 规则:
img {
max-width: 500px;
}
但是对于big_image.jpg,我收到width=500 和height=600。如何设置要调整大小的图像,同时保持它们的纵横比。
【问题讨论】:
标签: css image aspect-ratio