|
Uncle Jim's Web Designs and Tutorials Writing for Multiple Resolutions Site Design Optimization Recommendations Author: Jim Stiles |
|
Using Resolution Dependant Style Sheets (Highly Recommended)
The easiest method I found is to create two separate style sheets that set the property attributes on fonts for both high and low resolutions, then use JavaScript to dynamically write in the appropriate link to either file dependant upon the users screen resolution. You can, of course, use more than two font sizes or style sheet files. That decision lies with the individual designer.
// select_css.js
// -------------
// select the appropriate stylesheet according to the user's screen resolution
document.write("<link rel='stylesheet' type='text/css' href='");
if (window.screen.height <= 600) {
//resolution is 800x600 or less
document.write("small.css'>");
} else {
document.write("large.css'>");
}
I have also written an example that changes the layout and design for resolutions over or under 1024 and 800. It also applies different background colors, borders and images, depending on the user's resolution. You can see it here. Let let them choose. . .
There is also the option of giving the user the choice of which style sheet to view. |
|