Results 1 to 2 of 2

Thread: CSS Page Width - Percent or Pixels?

  1. #1
    Join Date
    Mar 2008
    Location
    North Texas
    Posts
    152

    Exclamation CSS Page Width - Percent or Pixels?

    Hey guys,

    Okay, I'm working on completely revamping my site. Here's my question - When working with CSS and page width, should I set it to a percent (Example 75% or should I set to a certain pixel width such as 750 pixels)?
    If so, what percent or what pixel width is going to work the best with all screen sizes.. or atleast most.


    Thanks again guys!

  2. #2
    Join Date
    Feb 2006
    Location
    Salisbury UK
    Posts
    4,332
    Percentage widths for a whole webpage worked reasonably well a few years ago but more and more people are using large resolution monitors so a flexible page now needs to look good for old computers using 500px wide or 800*600 screen resolutions right up to 1920*1200, so the answer is to test your design at these resolutions. It will be difficult to get it looking good at all resolutions.

    You can use min-width and max-width and perhaps set min-width at 780px width and max-width at say 1180px (allowing 20 px for a vertical scrollbar in 800 and 1200px wide resolutions).

    http://www.wickham43.supanet.com/tut...xminwidth.html

    However, min-width and max-width don't work in IE6 so you will need to fix the width in a conditional comment just for browsers IE6 or less. If you don't state a width for IE6 it just uses either the max-width or min-width as a fixed width, I can't remember which it uses.

    http://www.wickham43.supanet.com/tut...tionalcomments

    Put the conditional comment in the head section after the main stylesheet link with the min-width and max-width.
    Code downloaded to my PC will be deleted in due course.
    WIN7; IE9, Firefox, Opera, Chrome and Safari for Windows; screen resolution usually 1366*768.
    Also IE6 on W98 with 800*600 and IE8 on Vista 1440*900.

Posting Permissions

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