dcsimg
www.webdeveloper.com
Results 1 to 4 of 4

Thread: Align in direct middle of the page

  1. #1
    Join Date
    Sep 2006
    Location
    MA
    Posts
    494

    Align in direct middle of the page

    Is there a way to align a division exactly in the middle of the page horizontally and vertically?

  2. #2
    Join Date
    Dec 2005
    Location
    American, living in Toronto, ON. CANADA
    Posts
    6,746
    felgall knows how to do this
    http://www.felgall.com/cshow02.htm

  3. #3
    Join Date
    Apr 2006
    Posts
    225
    Use absolute positioning (top:50%;left:50%). Then give the container negative margins equal to half the size of the container width and height

    example:
    #middle {
    width:400px;
    height:50px;
    position:absolute;
    top:50%;
    left:50%;
    margin:-25px -200px;
    text-align:center;
    }

  4. #4
    Join Date
    Sep 2006
    Location
    MA
    Posts
    494
    Yup, thanks guys!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles