Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > HTML > HTML Code Clinic
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old January 19th, 2004, 04:47 PM
Authorized User
Join Date: Oct 2003
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
Default Positioning pages to fit all screen resolutions?

I guess it's the age old problem, how do I create Web pages that will bit whatever screen resolution the user has, without creating a different Web page for each resolution.

Is CSS position style sheets the way to do this?

Any help would be appreciated...

Old January 19th, 2004, 05:21 PM
richard.york's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts

I would say that most designers design to fit an 800 x 600 resolution. Otherwise you can use percentages, which will conform to any screen size.

<div style='width: 98%;'>

Or perhaps a formula that will adjust pixel widths in the way that the aspect ratio is adjusted for images. Which could be accomplished with a bit of mathematics and likely javascript.

If you dabble much with absolute/relative positioning you'll find the percentage method has some drawbacks and that absolutely positioned elements don't always find their exact place when using percentage widths. And you will find that Gecko based browsers have some horrible bugs when using percentages on nested elements. (At least that's been my experience!)

My personal method, since my site relies heavily on positioning and layers, is a set pixel width designed to fit an 800 x 600 screen size, which is not uncommon.. I don't much notice it being too small.. I use a 1600 x 1200 resolution on a 22" monitor and 1280 x 1024 on a 17" monitor.. you might well go mad trying to find the right formula that jives with your aesthetic design! Because not only can the resolution vary, but different monitor sizes and settings might also factor in!

And here again, just my .02

: )

Smiling Souls
Old January 19th, 2004, 05:27 PM
Authorized User
Join Date: Dec 2003
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts

You can use tables with relative paramaters

ie <table width=100%>
This will usually size to the clients screen

Let me know if this helps

Similar Threads
Thread Thread Starter Forum Replies Last Post
testing div positioning in different screen sizes crmpicco CSS Cascading Style Sheets 1 February 11th, 2008 05:02 AM
Sizing a form to fit different screen settings osemollie Pro VB 6 0 August 17th, 2006 11:09 AM
Screen resolutions larry Javascript How-To 7 July 21st, 2004 08:24 AM
Screen Resolutions Alaric VS.NET 2002/2003 3 October 9th, 2003 11:17 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.