Center div with position absolute

/ Published in: CSS
Save to your folder(s)

Copy this code and paste it in your HTML
  1. xyz
  2. {
  3. width: 140px;
  4. position: absolute;
  5. top: 0px;
  6. left: 50%;
  7. margin-left: -70px;
  8. }

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.