You can alter the size and shape of the text on a web page with a range of properties, outlined below:
This is the font itself, such as Times New Roman, Arial, or Verdana.
The font you specify must be on the user’s computer, so there is little point in using obscure fonts. There are a select few ‘safe‘ fonts (the most commonly used are arial, verdana and times new roman), but you can specify more than one font, separated by commas. The purpose of this is that if the user does not have the first font you specify, the browser will go through the list until it finds one it does have. This is useful because different computers sometimes have different fonts installed. So
font-family: arial, helvetica, for example, is used so that similar fonts are used on PC (which traditionally has arial, but not helvetica) and Apple Mac (which, traditionally, does not have arial and so helvetica, which it does normally have, will be used).
Note: if the name of a font is more than one word, it should be put in quotation marks, such as
font-family: "Times New Roman".
The size of the font. Be careful with this – text such as headings should not just be a paragraph in a large font; you should still use headings (
h2 etc.) even though, in practice, you could make the font-size of a paragraph larger than that of a heading (not recommended for sensible people).
This states whether the text is bold or not. In practice this usually only works as
font-weight: bold or
font-weight: normal. In theory it can also be
900, but seeing as many browsers shake their heads and say “I don’t think so”, it’s safer to stick with
This states whether the text is italic or not. It can be
font-style: italic or
This states whether the text is underlined or not. This can be:
text-decoration: overline, which places a line above the text.
text-decoration: line-through, strike-through, which puts a line through the text.
text-decoration: underlineshould only be used for links because users generally expect underlined text to be links.
This property is usually used to decorate links, such as specifying no underline with
This will change the case of the text.
text-transform: capitalizeturns the first letter of every word into uppercase.
text-transform: uppercaseturns everything into uppercase.
text-transform: lowercaseturns everything into lowercase.
text-transform: noneI’ll leave for you to work out.
font-family: arial, helvetica, sans-serif;
line-height property sets the height of the lines in an element, such as a paragraph, without adjusting the size of the font. It can be a number (which specifies a multiple of the font size, so ‘2’ will be two times the font size, for example), a length, a percentage or
text-align property will align the text inside an element to
text-indent property will
indent the first line of a paragraph, for example, to a given length or percentage. This is a style traditionally used in print, but rarely in digital media such as the web.