absolute绝对定位的破坏性实例页面
代码:
CSS代码:
.div { padding:20px; margin:10px 0 0 10px; background-color:#f0f3f9; float:left; } .abs { position:absolute; }
HTML代码:
<div class="div"> <img src="//image.zhangxinxu.com/image/study/s/s256/mm1.jpg" /> <p>图片无absolute</p> </div> <div class="div"> <img class="abs" src="//image.zhangxinxu.com/image/study/s/s256/mm1.jpg" /> <p>图片absolute后</p> </div>
效果:
图片无absolute
图片absolute后