How do I position a div at the bottom center of the screen

前端 未结 6 1532
一生所求
一生所求 2020-12-25 11:17

I have this css:

#manipulate
{
  position:absolute;
  width:300px;
  height:300px;
  background:#063;
  bottom:0px;
  right:25%;
}

I have t

6条回答
  •  自闭症患者
    2020-12-25 12:08

    Use negative margins:

    #manipulate
    {
      position:absolute;
      width:300px;
      height:300px;
      margin-left:-150px;
      background:#063;
      bottom:0px;
      left:50%;
    }
    

    The key here is the width, left and margin-left properties.

提交回复
热议问题