CSS Shorthand Properties

Eg.
Specifying a CSS property like this,

margin:5px 0;

actually means,

margin:5px 0px 5px 0px;

That first margin property means:

top and bottom margin = 5px ¦¦ left and right margin = 0px

so the ‘longer shorthand’ would be

margin:5px 0px 5px 0px; (T, R, B, L)

you could even use 3 values

margin: 5px 0 5px;

which means

top = 5px ¦¦ right and left = 0px ¦¦ bottom = 5px


Leave a Reply

 
NDK home | Expressing IT | Expressing Palate | Expressing Penmenship | Expressing Awe | Expressing Myself