1 reply [Last post]
spanky2012
spanky2012's picture
Offline
newbie
Last seen: 3 years 3 weeks ago
Timezone: GMT+13
Joined: 2011-11-25
Posts: 1
Points: 2

Hey Smile, just a quickie bout placing text inside a div,
i find when i place a div eg. a banner

#banner { height: 150px;
width 100px;
background-color: black;}

Then try to place text inside eg.

.header { font-family: Aerial
font-size: 15px;
color: red;
margin: 20px 200px}

It doesn't work.
All it does is put the surrounding divs out of place and uses default text font with no placement as stated in the code, essentially, using text class to place inside the div doesn't seem to have any effect.

Any ideas peeps??

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 days 5 hours ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

You have error in the example

You have error in the example rulesets, mis-spelt font name and missing line termination';', you are also trying to set a margin on the inner element greater than the fixed dimensions of it's parent so re-think that.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me