Ramin Hossaini (blog)

11Jun/070

CSS: Centering with Position:absolute

Private

If you're working with absolute positions in CSS, then you'll love this:
http://bluerobot.com/web/css/center2.html

Simple in theory:

  • Set position to absolute;
  • set left:50%;
  • and then set margin-left:-##px; (where ## is half the width of the object)
Share and make me happy:
  • Twitter
  • Facebook
  • Digg
  • StumbleUpon

Related posts:

  1. Learning CSS – The Basics
  2. Funny old school videos
  3. Making a ‘Sticky Footer’ in CSS
  4. Smart Menu-Hover
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


Please leave these two fields as-is:

No trackbacks yet.

Private
Bear