2013-04-23 99 views
0

要调整图像与jQuery函数调整容器内的图像大小?

$('div.container').resizable({ aspectRatio:true})

我把图像在这样一个div:

.container { width:350px; height:auto; background-color:black} 
.container img { width:100%; height:auto} 

<div class=container> 
    <img .../> 
</div> 

但你可以在这里看到住http://jsfiddle.net/Gz4ts/ 总是有一点点底部的边界。

我该如何解决这个问题?

回答

0

您应该使用max-width代替width

.container img { max-width:100%; height:auto}