我有一个简单的标记:
<div style="position: relative;">
<img src="http://placehold.it/350x150" style="position: absolute;">
</div>
<img src="http://placehold.it/350x150">
Run Code Online (Sandbox Code Playgroud)
为什么heck是父div没有扩大高度?
编辑:
最终的标记是这样的:
<div style="position: relative;">
<img src="http://placehold.it/350x150" style="position: absolute;">
<img src="http://placehold.it/350x150" style="position: absolute; display: none;">
<img src="http://placehold.it/350x150" style="position: absolute; display: none;">
</div>
Run Code Online (Sandbox Code Playgroud)
我正在使用jquery循环.因此position: absolute是必要的并且由插件自动添加.
css ×1