Forum Moderators: not2easy
#content{
background-color:ffffff; left-margin:20px;
}
where am i going wrong.
Regards Ian
So if you have a <div> containing a paragraph of text...
<div id="textbox">
<p>Here is some scintillating text.</p>
</div>
...do this in the stylsheet...
#textbox p {
margin: 20px;
}
...NOT...
#textbox {
margin: 20px;
}
I use <div> in this example because I don't generally use tables and I'm not 100% sure that cells work the same way <div>s do.
[edited by: createErrorMsg at 1:45 am (utc) on Aug. 7, 2004]
If you're using <div id="whatever"> this will refer to #whatever in your stylesheet.
You can use 'class' as many times as you like in your markup but you can only ever use a unique 'id' once in your markup. Edit - So if you have a div with the id of 'blah' once you've put that in your html (<div id="blah"></div> ) you can't use that same ID for another div.
With regard to where the original poster is going wrong:
#content{
background-color:ffffff; left-margin:20px;
}
Should be:
#content { background-color:#fff; margin-left: 20px;
}
If you want the margin to apply to all sides just put 'margin: 20px;'.