GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Easy way to center HTML page... (https://gfy.com/showthread.php?t=603409)

zoltie 04-28-2006 01:42 PM

Easy way to center HTML page...
 
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.

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>

StuartD 04-28-2006 01:46 PM

A quick and easy way is like this:

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

Otherwise, there's no real way to have a "center" option for a div quite like that.. especially if you're using "absolute" as a position setting.

aico 04-28-2006 01:52 PM

I just threw up in my mouth.

Validus 04-28-2006 02:02 PM

Quote:

Originally Posted by zoltie
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.

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>

try...


Code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<HTML>
<HEAD>
<TITLE>test</TITLE>
<META NAME="description" CONTENT="test">
<BASE TARGET="_top">

</HEAD>

<BODY style="background-color:#000000; margin:0px; padding:0px;">


<DIV ID="idElement1" style="text-align:center;">
        <IMG SRC="up-trailer_park_boys.jpg" NAME="idElement1Img" ID="idElement1Img" style="width:324px; height:233px; border:0px;" />
</DIV>


</BODY>
</HTML>


tip... don't CAP everything... and don't double up on styles.

Validus 04-28-2006 02:05 PM

Actually, you might want to add a width:100%; to the DIV tag...


Code:

<DIV ID="idElement1" style="text-align:center; width:100%;">


All times are GMT -7. The time now is 06:00 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123