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

If you aren’t comfortable with using negative margins, check this out.

HTML –

<div>
 Your Text
</div>

CSS –

div {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translate(-50%, -50%);
  margin: 0 auto;
}

Especially useful when you don’t know the width of the div.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)