Div不在底部移动

时间:2015-03-09 15:07:50

标签: html alignment

我创造了小提琴,并且有一个名为lowestDiv的div我想在底部,但它在中间。

如何将其移至底部并与屏幕左侧对齐。

这是我的Fiddle

这是我的小提琴代码中的div的一部分,我想在名为middleDiv的div之后向下移动

<div ¨id= "lowestDiv" style="width: 954px; margin-right: auto; margin-left: auto;">
    This div should be at bottom 
</div>

1 个答案:

答案 0 :(得分:1)

使用

 <div ¨id= "lowestDiv" style="position:absolute; bottom:0; left:0;width: 954px; margin-right: auto; margin-left: auto; background:red;">
        This div should be at bottom 
    </div>

我会 严重 考虑删除您的内联样式,使整个页面更容易阅读(在众多其他专业人员中)

#lowestDiv {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 954px;
  margin-right: auto;
  margin-left: auto;
  background: red;
}
<div id="lowestDiv">
  This div should be at bottom
</div>