我试图将一个 div 设置为左 0,但我不能。这是我的代码
.bottom
{
width: 100%;
position: relative;
height: 100px;
background: #21241c;
float: left;
margin: 0;
}
我不想绝对定位我的 div!
这是html
<div class='top'></div>
<div class='middle'></div>
<div class='bottom'></div>
我希望底部 div 始终位于中间 div 之下,宽度为 100%。我试过向左浮动和边距 0 但没有。我的底部 div 接缝位于屏幕的中央,左右两侧留有空白。 你能帮忙吗?
谢谢!
最佳答案
您只需使用下面的代码:
.bottom
{
width: 100%;
height: 100px;
background: #21241c;
float: left;
margin: 0;
}
关于css - 左对齐 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22984245/