Boxing

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
bobbyaa
Forum Newbie
Posts: 17
Joined: Wed Oct 13, 2004 4:54 pm

Boxing

Post 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
User avatar
AnarKy
Forum Contributor
Posts: 119
Joined: Tue Nov 02, 2004 1:49 am
Location: South Africa

CSS

Post by AnarKy »

I generally use CSS with tables,
all aligned centre.

Easy & works with all browsers if done right.
rehfeld
Forum Regular
Posts: 741
Joined: Mon Oct 18, 2004 8:14 pm

Post 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>
Post Reply