DH Templates

Is it better to use pixel as a width that percentage in a css template?

non-css programmers need not answer. I am trying to make my webpage template fit the entire browser box and have it fit on any monitor screen? Using the percentage option seems to work but it completly looks like crap with wide monitors. If pixel is what I need to use what width must it be? Thank You

Public Comments

  1. Two things: 1) Pixels are unscalable. If you use them, it won't fit correctly on all screens. 2) Don't bother trying to make it fit on all screens. Just leave empty strips on either side of the page (like Yahoo! Answers does).
  2. If you use a percentage, you need to add a margin -half code too. Also, if you are using position: relative; you should add the code margin: 0 auto; Anymore questions, feel free to send me an email at sk8rjwd@yahoo.com and I will do my best to help you.
  3. I find percentages cause massive headaches trying to maintain the same look and feel across different browsers and resolutions. If you are trying to create a visually complex design I'd steer clear. "Expanding" pages are a product of a previous generation and often the incorrect use of tables - a practice that is all but defunct. You will find most web-devs these days will code to a fixed width - usually a bit less than 1024px (to account for scrollbar and browser's frame - so call it somewhere between 950px and 1000px). Of course it does depend on your target audience - some still insist that 800x600 should be taken into account but it is actually estimated that less than 2% of web users are still using this resolution and even then it is only because they are browsing on mobile devices. There are many other ways you 'jazz' up your page if you are worried about blank/bland spaces - thanks to increasing bandwidths you can increase the size and complexity of your background images (though don't get carried away - I still try to keep my background sizes under 200KB for example). Here are some statistics on how screen resolution seems to be divided - it isn't 100% accurate but it is quite interesting: http://www.webdevelopersnotes.com/design/web-screen-resolution-usage-statistics.php
Powered by Yahoo! Answers