View Full Version : DIV align


Moonlit
08-04-2004, 10:27 AM
I align my title image, menu, and divider using DIV (see homepage)...but it doesn't show up centered on all browsers or screen widths. Is there any way to center the whole thing? (Could I put it all in a table and center that or something?)

Thanks a lot.

Chris
08-04-2004, 02:26 PM
try using align: center

Hope that helps
Chris

kittycat
08-04-2004, 04:59 PM
You have the div aligned to centre, then you have the things inside it positioned absolutely. You can't have both, so remove the position:absolute wherever it's included, as well as the top and left measurements.

Moonlit
08-04-2004, 11:49 PM
It's not really working out.... Could someone look at it again? I'm not sure what to do.

kittycat
08-05-2004, 01:36 AM
Try removing the negative left margins.

Moonlit
08-05-2004, 08:32 AM
Okay, I've got everything centered now. (Thank you.)
But I need to align the text and divider to specific heights from the top...how can I do that? And does all of this look correct?

<HTML>
<HEAD>
<title>Top Frame</title>
<LINK href="stylesheet.css" rel="stylesheet" type="text/css">
<style type="text/css">
A:hover
{color:#9999FF;
position: relative;
left: 1px;
top: 1px;
background:url(starzbar.gif);}
</style>
</HEAD>
<BODY topmargin="0">
<div align="center">
<div id=layer1 style="height: 90px; width: 424px; padding: 0; z-index:2;">
<img src="Title---Moonlit_Gallery(550x120).JPG" width="550" height="120" alt="Moonlit Gallery">
</div>

<div id=layer1 style="height: 90px; width: 550px; padding: 0;z-index:3;">

<a href="Home---Main.html" onClick="parent.leftframe.location='Home---Menu1.html';parent.rightframe.location='Home---Menu2.html'" target="middleframe">Home</a> &nbsp &nbsp

<a href="ArtGallery---Main.html" onClick="parent.leftframe.location='ArtGallery---Menu1.html';parent.rightframe.location='ArtGallery---Menu2.html'" target="middleframe">Art Gallery</a> &nbsp &nbsp

<a href="Dreams---Main.html" onClick="parent.leftframe.location='Dreams---Menu1.html';parent.rightframe.location='Dreams---Menu2.html'" target="middleframe">Dreams</a> &nbsp &nbsp

<a href="Library---Main.html" onClick="parent.leftframe.location='Library---Menu1.html';parent.rightframe.location='Library---Menu2.html'" target="middleframe">Library</a> &nbsp &nbsp

<a href="Personal---Main.html" onClick="parent.leftframe.location='Personal---Menu1.html';parent.rightframe.location='Personal---Menu2.html'" target="middleframe">Personal</a> &nbsp &nbsp

<a href="PhotoAlbum---Main.html" onClick="parent.leftframe.location='PhotoAlbum---Menu1.html';parent.rightframe.location='PhotoAlbum---Menu2.html'" target="middleframe">Photo Album</a> &nbsp &nbsp

<a href="Contact---Main.html" onClick="parent.leftframe.location='Contact---Menu1.html';parent.rightframe.location='Contact---Menu2.html'" target="middleframe">Contact</a><br>
</div>

<div id=layer1 style="height: 90px; width: 424px; padding: 0;z-index:1;">
<img src="Divider---purplelong(817x30).GIF" width="817" height="30" alt="Divider Purple">
</div>
</div>
</BODY>

kittycat
08-05-2004, 04:50 PM
Try setting a top margin then, that shouldn't mess up the centring.

Moonlit
08-08-2004, 10:39 AM
I put in a top margin...but for some reason that didn't change anything.