Consider this code...
&l
-
Add overflow: hidden
to your #outer
rule: http://jsfiddle.net/saluce/qJWte/
<div id="outer" style="position:absolute;width:100px;height:100px;border:1px solid black; overflow: none">
<div id="inner">
<img src="http://rabbitempire.org/wp-content/uploads/Pet-Rabbit-Facts.jpg">
</div>
</div>
讨论(0)
-
div#outer { overflow:hidden; }
demo here: http://jsfiddle.net/J34aJ/
讨论(0)
-
re-write your outer div style to apply overflow:hidden
<div id="outer" style="position:absolute;width:100px;height:100px;border:1px solid black; overflow:hidden;">
<div id="inner">
<img src="http://rabbitempire.org/wp-content/uploads/Pet-Rabbit-Facts.jpg">
</div>
</div>
讨论(0)
-
You can just apply img { max-width: 100%; height: auto; }
to image tag
讨论(0)
-
You can lose the #inner
div and add overflow: hidden;
to the #outer
div.
#outer {
overflow: hidden;
}
讨论(0)
-
It's as simple as this:
overflow: hidden;
讨论(0)