The Web Just This Site

NM Web Tutorials

CSS properties and values for Fonts

Here is a list of properties and values that you can simply add to your Style Rules, experiment, combine, go nuts!

Fonts

font-family: Verdana, Arial, Helvetica, sans-serif;

Typically you would want put this in with the <body> as the selector, but there is no reason you can’t do it to other things either. Here is another set of fonts that might be useful:

font-family: Arial, Helvetica, sans-serif;
font-family: "Times New Roman", Times, serif;
font-family: "Courier New", Courier, monospace;
font-family: Georgia, "Times New Roman", Times, serif;
font-family: Geneva, Arial, Helvetica, sans-serif;

You can use any font you want, in any order you want.

Font Colours

color: #ffffff;

To get a list of more HEX colour codes, go here.

Font weights, sizes, and styles

font-weight: bold;

Values that you can give to this property are “bold”, “bolder”, “light”, “normal”.

font-size: 36px;

Values that you can give to this property are numbers followed a unit of measurement, you can use “px” (pixels), “%”, or“em”.

font-style: italic;

Values that you can give to this property are “italic”, “oblique”, or “normal”.

Text Decorations

text-decoration: underline;

This one is a little more complex, but not by much.

underline; makes an underline.
blink; text will flash on and off.
line-through; puts a line through your text.
overline; makes an overline.
none; Overrides anything that has a text decoration by default.

That concludes this list, anything that has to do with positioning text is in the section where I talk about positioning content. As far as fonts go, you may also find this article interesting:

A List Apart: How to Size in CSS

BACK