Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 04-28-2006, 01:42 PM   #1
zoltie
So Fucking Banned
 
Join Date: May 2002
Posts: 855
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>
zoltie is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-28-2006, 01:46 PM   #2
StuartD
Sofa King Band
 
StuartD's Avatar
 
Join Date: Jul 2002
Location: Outside the box
Posts: 29,903
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.
StuartD is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-28-2006, 01:52 PM   #3
aico
Moo Moo Cow
 
Join Date: Mar 2004
Location: Washington State
Posts: 14,748
I just threw up in my mouth.
aico is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-28-2006, 02:02 PM   #4
Validus
Confirmed User
 
Industry Role:
Join Date: Jul 2001
Location: Calgary, Canada
Posts: 4,012
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 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-28-2006, 02:05 PM   #5
Validus
Confirmed User
 
Industry Role:
Join Date: Jul 2001
Location: Calgary, Canada
Posts: 4,012
Actually, you might want to add a width:100%; to the DIV tag...


Code:
<DIV ID="idElement1" style="text-align:center; width:100%;">
Validus is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.