SitePoint Sponsor

User Tag List

Results 1 to 10 of 10

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Aug 2008
    Location
    sunshinecoast
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    centering web page

    Hi,
    I am trying to center a web page when viewed on a wide screen.
    This is hard for me to check as i do not have a wide screen yet.
    I'm building the web pages with HTML and CSS.
    Any help would be much appreciated....

    Thank you :>

  2. #2
    SitePoint Member
    Join Date
    Nov 2009
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can put your entire site in div tags and using css set:

    *a width
    *margin-left to auto
    *margin-right to auto

    That will center the page
    Last edited by SublimeSite; Nov 3, 2009 at 20:20. Reason: typo

  3. #3
    SitePoint Member
    Join Date
    Oct 2009
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah if you put your entire site in a div with an id of "wrapper", your css would look like:

    #wrapper{
    margin:0 auto;
    width:900px;
    }

    You can change the width but you get the point.

  4. #4
    SitePoint Member
    Join Date
    Aug 2008
    Location
    sunshinecoast
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your reply.
    Would that be the same if I was just using HTML?

  5. #5
    SitePoint Member
    Join Date
    Oct 2009
    Location
    Las Vegas, NV
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if your not using an external style sheet use...
    <div style="margin:0 auto;"> </div>

  6. #6
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Sellbits View Post
    if your not using an external style sheet use...
    <div style="margin:0 auto;"> </div>
    If you are not using an external stylesheet, you are doing it wrong!

  7. #7
    SitePoint Member
    Join Date
    Nov 2009
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have a hard time doing this, I was fooled that doing this one needs to have an “text-align: center;” on your stylesheet.

  8. #8
    @alexstanford Alex's Avatar
    Join Date
    Apr 2004
    Location
    Jacksonville, Florida
    Posts
    757
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    — Alex Stanford @alexstanford tumblog about.me in fb G+ K
    TechTalkin — The Premier Community for Technology Enthusiasts and Professionals
    Full Ambit Media — Zero Sacrifice Web Design & Development; Made in the USA @fullambit in fb G+ K

  9. #9
    SitePoint Member
    Join Date
    Aug 2008
    Location
    sunshinecoast
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks

  10. #10
    SitePoint Member
    Join Date
    Aug 2008
    Location
    sunshinecoast
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cheers


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
  •