View Full Version : Center


Emilie
08-05-2004, 12:36 PM
I have an Iframe thingy, and it's all very beautiful, but I'd like it to be in the center of the page
So first I thought of adding a 'left' to the #page, but I wasn't sure what to put in there, because it'd like it to be centered in every screen resolution, so also in 800x600 and above
This is what I have, I haven't put it up online yet, so thats why I just have the html:
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
body{
background-color: #FF9829;
text-align: left;
cursor: crosshair;
scrollbar-face-color : #FF9829;
scrollbar-highlight-color : #FF9829;
scrollbar-3dlight-color : #FFFFFF;
scrollbar-shadow-color : #FF9829;
scrollbar-darkshadow-color : #FF9829;
scrollbar-track-color : #FFFFFF;
scrollbar-arrow-color : #FFFFFF;
}

a { text-decoration: none; color:#000000; }
a:active { text-decoration: line-through; }
a:hover { text-decoration: underline overline; }

#page {
background: url('headrn.gif');
position: absolute;
top: 0px;
width: 750px;
height: 270px;
text-align: left;
}

iframe {
border: 0;
position: absolute;
top: 270px;
left: 0px;
width: 750px;
height: 500px;
}
</style>
</head>
<body>
<div id="page"><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<IMG SRC="headrn.gif" USEMAP="#headrn.gif" WIDTH=750 HEIGHT=270 BORDER=0>
<MAP NAME="headrn.gif">
<AREA SHAPE=RECT COORDS="147,253,197,261" href="frames.shtml" alt="a. Mucho info over Ruben" target="main">
<AREA SHAPE=RECT COORDS="200,253,240,261" href="frames.shtml" alt="b. Goodies over de Lama's" target="main">
<AREA SHAPE=RECT COORDS="242,253,312,261" href="frames.shtml" alt="c. Ruben en Nathan stuff" target="main">
<AREA SHAPE=RECT COORDS="313,253,375,261" href="frames.shtml" alt="d. All het andere" target="main">
</MAP>
<iframe src="mypage.html" frameborder="0" name="main"></iframe>
</div></body>
</html>

Can anyone help me by centering the page?
I tried the <center> tags by the way, but they don't work.
Thanks!

pb&j
08-05-2004, 03:32 PM
center tags would not work considering you are using absolute positioning.

have you tried using 50% in place of 0px on the left value? untested but it may do the trick.

Emilie
08-05-2004, 07:03 PM
Nope, sorry, didn't work

Emilie
08-05-2004, 07:20 PM
Is there maybe another way for the frames in the center, but the top still attached to the top like it is now?

jazzberry
08-05-2004, 07:21 PM
i noticed that you're meta tag was after the <div> tag. You may want to try puting it after the <head> tag :)

Emilie
08-05-2004, 07:24 PM
Oh, yea, there are 2 of them :-S
Thanks!

Emilie
08-06-2004, 07:17 AM
Little help please? I'm trying to get it right as soon as possible, so I can put the thing online

MaGiCSuN
08-06-2004, 04:16 PM
<center>iframe here</center>

you do have to take out the absolute positioning part though on both parts (page div and the iframe). Can you show me the page online so i can see the actual image you are working with? Then i can find a better solution for it :)

Love,
Mirna

Emilie
08-06-2004, 05:49 PM
Well, thats the thing, my mom wont buy the webspace for me unless I finished the website, but I'll finish the rest first and then come back.
I think it's a waste of space to register for a free website which I wont be using.