Click to See Complete Forum and Search --> : Creating a page that resizes in browser


fretless58
10-28-2006, 01:17 PM
I've noticed many sites lately that will resize themselves as you resize the browser window. The text and graphics will realign themselves to stay within the borders, and nothing will overlap. How is this achieved?

mshalabi
10-28-2006, 01:23 PM
percent values for widths..

fretless58
10-28-2006, 01:34 PM
Thanks for the quick reply - could you expand on that a bit?

Ascendancy
10-28-2006, 01:43 PM
Instead of using pixels you use percentages.

mshalabi
10-28-2006, 01:46 PM
give the main container width in percent not in pixel..
e.g:

<body>
<div style="width: 95%">
..
..
</div>
</body>

Ascendancy
10-28-2006, 02:19 PM
It doesn't always work 100% though. I have had some problems in Firefox with some pages, but it does work out for the most part.