Re: How to center a layer

message from dakin01 on 19 Jul 2004
Why don't you just use tables. It's a lot easier and we're not to the point of
<table width="600" height="100%" border="0" align="center" cellpadding="0"
cellspacing="0">
<tr>
<td valign="middle">
<table width="100%" border="0" align="center" cellpadding="0"
cellspacing="0">
<tr>
<td> </td>
</tr>
</table>
</td>
</tr>
</table>
 
Thierry Koblentz replied to dakin01 on 19 Jul 2004
IMO, it is better to go with CSS for a cleaner markup.
Gary White posted this nice solution a while back.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>A good use of negative margins</title>
<style type="text/css">
#content{
position: absolute;
top: 50%;
left: 50%;
margin-left: -200px;
margin-top: -100px;
width: 400px;
height: 200px;
background-color: #006;
color: #fff;
}
</style>
</head>
<body>
<div id="content">Your content goes here.</div>
</body>
</html>

HTH,
Thierry

"dakin01" <webforumsuser@macromedia.com> wrote in message
news:cdgglg$cgu$1@forums.macromedia.com...
 
Gary White replied to dakin01 on 19 Jul 2004
That depends on the browser rendering the invalid and unreliable 100%
height.

Gary
 

Archived message: Re: How to center a layer (Macromedia Dreamweaver Web Design)