Lesson 8: CSS Attributes

So just what can you style using CSS? Here are some common ones. I won’t go into the details of where you can validly use them – you can find that http://w3schools.com/css/default.asp[here].

Lets you set the background. It can take a colour, or an image (in the form url(path/to/your/img))
Sets the border around an element. It’s least confusing to set the individual properties separately (border-top, border-left, border-right, border-bottom). You can set a colour, width, and style (dotted, dashed, solid, double, groove, ridge, inset, outset)
Sets the font. You can specify the font name, size, style (normal, italic, oblique), and weight (normal, bold, bolder, lighter).
Sets aside some space outside the border. It’s least confusing to set margin-top, margin-left, margin-right and margin-bottom separately.
Sets aside some space inside the border, before the actual content. It’s least confusing to set padding-top, padding-left, padding-right and padding-bottom separately.
left, right, center or justify.
none, underline, overline, line-through, and blink (ugh!).
Indents the first line of text.


CSS allows you to name certain colours like black, white, red, green, etc. It also allows you to specify any colour in the rainbow. Here’s some more information.

Previous Lesson Index Next Lesson