SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru
    Join Date
    Mar 2004
    Posts
    639
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to create page with box in the middle of the screen?

    Hello,

    I need to create simple page with just one DIV in the middle of the screen. I've tried to do it, but I can't find out how to do align this box vertically.

    Can you help me with this please?

  2. #2
    Village Idiot cgustaveson's Avatar
    Join Date
    May 2008
    Posts
    454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by al9 View Post
    Hello,

    I need to create simple page with just one DIV in the middle of the screen. I've tried to do it, but I can't find out how to do align this box vertically.

    Can you help me with this please?
    Well vertical align is much easier the horizontal align.

    Try this

    margin: auto 33% auto 33%

    or

    #divsid { margin-left: auto; margin-right: auto; text-align: left;}

    that might help you a bit.
    Smoke Lounge | Hookah Store and Community
    Shisha Tobacco
    SitePoint Users get 5% off use promo code s1t35p

  3. #3
    Ripe Tomatos silver trophybronze trophy Rayzur's Avatar
    Join Date
    Jun 2007
    Location
    Texas
    Posts
    4,174
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Hi al9,

    Have a look at Paul's "Easy Vertical Centering with CSS" article on search-this.com

    Here is Paul's "Centered Page" demo from his site.


    Here are some additional links from Georg Gunlaug's Demo Page



    1. demo #1 - demo (2007)
    2. demo #2 - demo (2007)
    3. demo #3 - demo (2007)
    4. demo #4 - demo (2007)


Bookmarks

Posting Permissions

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