PDA

View Full Version : NTML help



detoxed
04-27-2006, 08:02 PM
Can you guys tell me how to center a html page. The page below looks ok in 800 by 600 but looks off if you use 1024 by 768 or higher. Haw do I make it center regardless of resolution.

http://zoltic.hostrocket.com/test.html


html code:

<HTML>
<HEAD>
<TITLE>test</TITLE>
<META NAME="description" CONTENT="test">
<BASE TARGET="_top">
<STYLE TYPE="text/css">BODY {margin-left:0; margin-right:0; margin-top:0;}</STYLE>
</HEAD>

<BODY SCROLL="auto" BGCOLOR="#000000" TOPMARGIN=0 LEFTMARGIN=0>

<DIV ID="idElement1" style="position:absolute; top:88px; left:233px; width:324px; height:233px;"><IMG SRC="up-trailer_park_boys.jpg" NAME="idElement1Img" ID="idElement1Img" WIDTH=324 HEIGHT=233 BORDER=0></DIV>



</BODY>
</HTML>

Bogie
04-27-2006, 08:06 PM
Can you guys tell me how to center a html page. The page below looks ok in 800 by 600 but looks off if you use 1024 by 768 or higher. Haw do I make it center regardless of resolution.

http://zoltic.hostrocket.com/test.html


html code:

<HTML>
<HEAD>
<TITLE>test</TITLE>
<META NAME="description" CONTENT="test">
<BASE TARGET="_top">
<STYLE TYPE="text/css">BODY {margin-left:0; margin-right:0; margin-top:0;}</STYLE>
</HEAD>

<BODY SCROLL="auto" BGCOLOR="#000000" TOPMARGIN=0 LEFTMARGIN=0>

<div align="center">
<center>

<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" height="100%">
<tr>
<td width="100%"> <center><DIV ID="idElement1" style="width:324px; height:233px;">

<IMG SRC="up-trailer_park_boys.jpg" NAME="idElement1Img" ID="idElement1Img" WIDTH=324 HEIGHT=233 BORDER=0 align="left"></DIV></center>
</td>
</tr>
</table>



</center>
</div>



</BODY>
</HTML>There ya go!

tsehou
04-28-2006, 12:33 AM
In the body styling tag, just add:

text-align: center;


So here is the new body style definition:

<STYLE TYPE="text/css">BODY {margin-left:0; margin-right:0; margin-top:0; text-align: center;}</STYLE>