如何防止一个div包裹在另一个div下?具体来说,我希望第二个div始终位于第一个div的右侧,即使调整浏览器宽度以使第二个div的内容必须换行。
我总是希望divs并排:
并且永远不会这样,即使调整浏览器窗口大小以使第二个div的内容必须包装:
<!DOCTYPE html>
<html lang="en">
<body>
<div class="columns">
<div style="background-color: #990000; width:70px; float: left">
Pic
</div>
<div style="background-color: #00FF00; float: left; " >
body some interesting large amount of content. some interesting large amount of content.
</div>
</div>
</body>
</html>
答案 0 :(得分:5)
<div class="columns">
<div style="background-color: #990000; width:70px; float: left">
Pic
</div>
<div style="background-color: #00FF00; margin-left: 70px;" >
body some interesting large amount of content. some interesting large amount of content.
</div>
</div>