SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Member
    Join Date
    Feb 2007
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Quick Question regarding centering a website

    Is it better to have a website centered or set to the left margin when opened in a large screen monitor?

    Thanks

    p.s. yeah, what code would be used to do either one?

  2. #2
    From space with love silver trophy
    SpacePhoenix's Avatar
    Join Date
    May 2007
    Location
    Poole, UK
    Posts
    5,068
    Mentioned
    103 Post(s)
    Tagged
    0 Thread(s)
    The norm for viewing a site that does not take up the whole screen seems to be for the site to be centred.

  3. #3
    SitePoint Member
    Join Date
    Feb 2007
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SpacePhoenix View Post
    The norm for viewing a site that does not take up the whole screen seems to be for the site to be centred.
    Thanks...I was talking about viewing sites in such wide screen as a 24 inch screen. It looks to me kind of difficult to have a website that will take the whole 24'' screen.

  4. #4
    SitePoint Wizard bronze trophy Tailslide's Avatar
    Join Date
    Feb 2006
    Location
    Bedford, UK
    Posts
    1,687
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Don't mind which - depends on the design.

    To centre a site I add "text-align:center;" into the body element CSS rule to centre the site in older browsers. Then I add "margin:0 auto;" into the rule for the main containing div to centre in the newer browsers plus "text-align:left;" to normalise the text alignment.
    Little Blue Plane Web Design
    Blood, Sweat & Rust - A Land Rover restoration project

  5. #5
    WordPress Freelancer banago's Avatar
    Join Date
    Dec 2006
    Location
    Vlorė, Albania
    Posts
    446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by howard_two View Post
    Is it better to have a website centered or set to the left margin when opened in a large screen monitor?

    p.s. yeah, what code would be used to do either one?
    The left is the default. Where as center, try this in css:

    Code CSS:
    body{
           text-align: center;
           }
    the_div{
           margin: 0 auto;
           }
    WPlancer.Com - PHP & WordPress Developer
    ProverbHunter - English Proverbs Explained

  6. #6
    SitePoint Enthusiast trishacupra's Avatar
    Join Date
    May 2008
    Location
    Australia
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I find it much easier to read a layout that is centred on the screen rather than flush to the left. I use a 20" monitor.

    I also think it looks a whole lot better, and it's what I always do as a web designer myself.
    Trisha Cupra, Web Design Watchdog
    Protecting website owners from the most painful online mistakes

  7. #7
    SitePoint Zealot kazbek's Avatar
    Join Date
    Jun 2007
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by trishacupra View Post
    I find it much easier to read a layout that is centred on the screen rather than flush to the left. I use a 20" monitor.

    I also think it looks a whole lot better, and it's what I always do as a web designer myself.
    I think it's the question of your habit.

  8. #8
    SitePoint Enthusiast trishacupra's Avatar
    Join Date
    May 2008
    Location
    Australia
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The way I see it, if you put a piece of paper in front of you on your desk so you could read it, would you put it over to the left of your desk, or smack-bang in the middle of your desk? I'd put it in the center, myself. To me, the webpage layout is like a piece of paper, and the whole screen is the desk.
    Trisha Cupra, Web Design Watchdog
    Protecting website owners from the most painful online mistakes


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
  •