I want to contain an image into a 250 x 250 div, forcing the image to resize but not stretch. How can I do this? By the way, the image will usually be bigger than the div it
#container img { max-width:250px; max-height:250px; width: 250px; height: 250px; border:1px solid #000; } The img will lose aspect ratio 0 讨论(0) 查看其它7个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复
#container img { max-width:250px; max-height:250px; width: 250px; height: 250px; border:1px solid #000; }
The img will lose aspect ratio