我有这样的东西:
<div class="container">
<div class="left">
(an image)
</div>
<div class="right">
(some divs and other text)
</div>
</div>
我想并排对齐 2 个 div
.container {
width: 100%;
}
.left, .right {
float: left;
width: 50%;
}
我需要做什么,因为这不起作用
最佳答案
您的代码没有问题... Div 并排对齐...
.container {
width: 100%;
}
.left,
.right {
float: left;
width: 50%;
border: 1px solid red;
box-sizing: border-box;
}
<div class="container">
<div class="left">
(an image)
</div>
<div class="right">
(some divs and other text)
</div>
</div>
关于html - 并排对齐两个 div,覆盖整个页面宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43426117/