HTML Styles

Adding styles to an element…

  • colour

  • font

  • size…

To define a style, you must write in CSS format.

e.g. <tagname style="property:value;">

  • property is a CSS property. value is a CSS value.

Background Colour

CSS property that defines background colour a HTML element.

Sets background colour for page to powderblue.
  • You can do this with as many elements as you want, nested or not!

Text Colour

CSS property that defines text colour for HTML element.

Heading -- Blue
Paragraph -- Red

Fonts

CSS font-family property defines font to be used.

Text Size

CSS font-size property defines text size.

  • Uses percentages

Text Alignment

CSS Text-align property defines horizontal text alignment.