我怎样才能在一个 div 中制作这个?目前它有两个 div,但我需要将它放在一个 div 中,就像左侧显示的图像和右侧显示的文本一样。
<div style='float: left; margin-left: 6px; margin-bottom: 6px; height: 191px;'>
<img src='http://www.cnn.com/features/150px.jpg' width='100' height='100' border='0' alt='Lipsum' />
<br />
<img src='http://www.cnn.com/features/b150px.jpg' width='100' height='100' border='0' alt='Lipsum' />
<br />
<br />
<br />
</div>
<div id='lipsum'>
<p>first paragraph</p>
<p>second paragraph</p>
</div>
最佳答案
你可以使用clear: left
:
参见: http://jsfiddle.net/thirtydot/FN4h4/
CSS:
img {
float: left;
clear: left;
margin: 0 6px
}
HTML:
<div id='lipsum'>
<img src='http://www.cnn.com/features/150px.jpg' width='100' height='100' border='0' alt='Lipsum' />
<img src='http://www.cnn.com/features/b150px.jpg' width='100' height='100' border='0' alt='Lipsum' />
<p>Lorem ipsum..</p>
<p>Lorem ipsum..</p>
</div>
关于asp.net - 我怎样才能把它变成一个div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5964779/