Page 1 of 1

Boxing

Posted: Sat Nov 06, 2004 1:47 am
by bobbyaa
What is the most effective way to create the content "box" on a webpage? Should I set the margins with css or what?

Understand, that when i say content box, I am referring to like a white area with border in the middle of the page where EVERYTHING on the webpage would go, etc.

Robert

CSS

Posted: Sat Nov 06, 2004 2:08 am
by AnarKy
I generally use CSS with tables,
all aligned centre.

Easy & works with all browsers if done right.

Posted: Sun Nov 07, 2004 8:30 pm
by rehfeld
this works in all browsers(to my knowledge)
the text-align: center on the body is for ie

of course adjust the top and bottom margin to your liking, as well as the width and height, i just put them there for demonstration

Code: Select all

<style>
body &#123; text-align: center; &#125;
#box &#123; text-align: left; margin: 1em auto 1em auto; width: 80%; height: 80%; border: 1px solid #000; &#125;
</style>
<body>

<div id="box">This be the box</div>


</body>