Forum Moderators: not2easy

Message Too Old, No Replies

cols again

fixed?

         

kiwi

2:27 pm on May 11, 2004 (gmt 0)

10+ Year Member



Sorry that I keep asking, but I just don't get it!
If I have it like this the margins left, right ant bottom don't do anything. I only have a top-margin of 50px. But I want a margin on the left, right and bottom.
I guess I'll use tables or something else...are tables just as good?
Thanks for your help/

body{ margin-right:50px;
margin-left:50px;
margin-top:50px;
margin-bottom:50px;
padding:0px;
height:100%;
width:100%; }

#leftcontent { position:absolute;
left:0px;
border:1px solid;
padding:0px;
background: #ffc;
width:150px;
height:100%;}

#centercontent{position:absolute;
margin-left:150px;
border:1px solid;
padding:0px;
background: #ff0;
width:150px;
height:100%;}

#rightcontent{position:absolute;
margin-left:300px;
border:1px solid;
padding:0px;
background: #ff0;
width:150px;
height:100%;}

<html>
<head>

<link rel="stylesheet" type="text/css" href="layout.css">
</head>

<body>

<div id="leftcontent">
chocolate-kiwi chocolate-kiwi
</div>
<div id="centercontent">
chocolate-kiwi chocolate-kiwi
</div>
<div id="rightcontent">
</body>
</html>

photon

6:36 pm on May 11, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you are using
postion:absolute;
on all your DIVs, then the margin is essentially superfluous. You'll need to assign
left:150px;
for the "centercontent" DIV and and
left:300px;
for the "rightcontent". You should include a
top
value as well for all the the absolutely positioned DIVs.