Hi
I am writing css, and my text is going right the way across my page.
I was wondering if anyone can help me sort this out. I'm a newbie to writing code, so be gentle! lol.
I am guessing I will need to set the left and right margin. Do you know how I would do this?
Page 1 of 1
setting margins
#2
Posted 13 April 2009 - 04:13 PM
p{margin:0 1.5em 0 1em}You can use any type of measurements, em, pt, px etc.
The numbers come in a compass sequence (north east south west, or clockwise, whichever is easier for you to remember).
and remember, margins are outside an element, padding is inside.
P.S the p{} means it will apply to all <p></p> tags
#3
Posted 13 April 2009 - 05:01 PM
thanks, with this, am i able to set the margin a different colour from the center where i want text, or is that a little more complex? thanks x
- ← Layout gets messed up if the browser is too small
- CSS, XHTML/HTML & JavaScript
- Java Script & secrurity →
Share this topic:
Page 1 of 1
Help


















