Ok, I am trying to clean up my markup language and have always used tables. I am now finally learning div’s and it is working great so far… Here is the question,
I want to center my whole site. I see the problem in the <div align=“center”> tag to be inefficient as all my text gets centered. I only want to center all the contained div’s.
The reason for using an extra <div> instead of styling <body> is that IE7 and older sometimes behave oddly when you apply certain types of styling to <body>.
Without seeing a live page and guaging what your expected outcome is I would suggest that you position your elements using position: relative; and use floats instead of positioning everything absolutely.
It does take a little more testing to get what you want, but I think you’ll be happier with the overall outcome.
I think you are looking for something like this:
<body>
<div id="wrapper">
<ul id="nav">[...]</ul>
<div id="logo">[...]</div>
<div id="tagline">[...]</div>
<div id="sidemiddle">
Place all content for side bar here
</div>
<div id="body">
Place all content for body here
</div>
<div id="footer">[...]</div>
</div>
</body>
I’ve done it by putting what i want in a div, then setting the left and right margins to some value or auto. works weird when browser size changes though.