PDA

View Full Version : Web layout for diff screen resolutions



nest
March 21st, 2002, 20:51
I am designing my webpage based on 800x600 screen resolution..
I was wondering is there a way to center the webpage for larger screen resolutions? (i.e. 1024x768). I am using <div> tags..

thanks....

R. K. Raja
March 21st, 2002, 20:58
Just put < CENTER > after the BODY tag....

Bruce
March 21st, 2002, 21:02
<div align="center">

nest
March 21st, 2002, 21:09
thanks for the reply..
What if I have several <div> tags which are absolutely positioned?
Is there a way for me to find out the screen resolution and then calculate the relative position and center the screen?

thanks..

meow
March 21st, 2002, 21:21
How can you position something "relative" that's already potioned "absolute"?

The easy way out: Don't design it for any resolution in particular. Keep it liquid.

is0lized
March 21st, 2002, 22:24
<HTML>
<HEAD>
<TITLE>name</title></head>
<body topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" marginwidth="0" marginheight="0">
<div align="center">
<table width="82%" border="0" cellspacing="0" cellpadding="0" valign="top"><tr><td>content here
</td></tr></table></div></body>
</html>

this will work for all screen res

Canuckkev
March 21st, 2002, 22:56
Ya, just do that. But keep in mind that people with 1600X1200 will have a tiny little box on their screen, but, they are probably used to it anyways.

is0lized
March 21st, 2002, 23:24
it does it by %, so it wont be THAT small

JALman
March 27th, 2002, 01:03
Has anyone ever tried to make a table of 100 percent width with the cell containing the primary content not having a width attribute? I've experimented with this and I think it may the best way to serve content for different screen resolutions



<div align="center">
<table width="100%" border="0">
<tr>
<td width="200">
</td>
<td width="10">
<!-- spacer -->
</td>
<td>

MAIN CONTENT

</td>
<td width="10">
<!-- spacer -->
</td>
<td width="200">
</td>
</tr>
</table>
</div>


Notice how every other cell is given a width

invalid
March 27th, 2002, 17:42
you should abide to standards and always use the <div> tag and not the <center> tag

meow
March 27th, 2002, 18:11
Errr...both are standard and allowed in Transitional. Neither of the methods are allowed in Strict. But what has that to do with anything? :confused:

crj
March 30th, 2002, 01:11
why not < center> ?

i've always used < center> for all my pages....

i hate how everything inside a table has to finish loading before it shows up...

meow
March 30th, 2002, 02:03
<center> is just shorthand for <div align="center">. Both are cleaned out from (X)HTML Strict.

cheatpark
March 30th, 2002, 15:06
Originally posted by Bruce
<div align="center">
To end it you would have to do </div> . Otherwise its not proper html.

meow
March 30th, 2002, 16:16
:confused2

Bruce
March 30th, 2002, 22:02
Originally posted by cheatpark

To end it you would have to do </div> . Common sense.