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
Boxing
Moderator: General Moderators
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
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 { text-align: center; }
#box { text-align: left; margin: 1em auto 1em auto; width: 80%; height: 80%; border: 1px solid #000; }
</style>
<body>
<div id="box">This be the box</div>
</body>