Originally Posted by
bazmanblue
in css you can assign divs to layers by numbers and is standard xhtml.
No, you cannot, as there is no such thing as "layers" in HTML, or XHTML. Plus, CSS cannot assign "divs" to anything at all. A DIV is an element, and CSS can apply styles to a DIV, but it cannot "apply" a DIV to anything. I think you need to go back to fundamentals. Drop Dreamweaver, learn the basic building blocks, and get your terminology down.
As I've explained, if you style your main container DIV properly, then DIVs defined inside of it will fall into place naturally. Start with a simple page:
[html]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Sample Page</title>
</head>
<body>
<div id="container">
</div>
</body>
</html>
[/html]
Now, create a CSS class, and assign it to the DIV.
[html]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Sample Page</title>
<style type="text/css">
.container
{
width: 200px;
margin: auto auto;
}
</style>
</head>
<body>
<div id="container" class="container">
<p>Some content to flesh out the div.</p>
</div>
</body>
</html>
[/html]
Add more CSS declarations to the class until it appears as you wish. Frankly, there is rarely a need to do any vertical centering. Users expect pages to start at the top of the browser, just as they expect words to appear at the top of book page. I would stick with simplistic, basic CSS.
Then, you simply add child DIVs.
[html]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Sample Page</title>
<style type="text/css">
.container
{
width: 200px;
margin: auto auto;
}
</style>
</head>
<body>
<div id="container">
<div id="child1"><p>A child div</p></div>
<div id="child2"><p>Another child</p></div>
</div>
</body>
</html>
[/html]
You can see if you copy my source code, that the child DIV elements automatically center, because of the relationship they have with the parent DIV.