SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2008
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How do I fix the width on a page/site?

    Hi!
    I would like to know how to fix the width on the pages of a website. I noticed that by default my pages seem to go on way too far to the right and they repeat the header/sitebranding. I have 1024 x 768 resolution, but my screen is only 10 inches height, about 13 inches width, so when people with bigger screens view the site it makes an awful blank spot on the right, and I had to readjust my header to something like 21 inches which can't look good on bigger screens.

    So my question is, how can I adjust a fixed width for my site? Is it done through my CSS style sheet?

  2. #2
    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)
    Hello

    You would start with some HTML to create a main 'container' for all the contents of your site.
    Code HTML4Strict:
    <div id="container"><!-- everything goes here --></div>
    Then in your .css you could add:
    Code CSS:
    #container{
      width:760px;
      margin:0 auto
    }
    The margin:0 auto part will center it in the browser.

  3. #3
    SitePoint Enthusiast
    Join Date
    Apr 2008
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Got it, thank you!


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
  •