CSS Fonts

body {font-style:oblique;}

Not much to this "style". The code above will give you text slanted to the right like what you're reading now. Using "italic" will give you italicized text. Using "normal" will return things to their normal look.

body {font-weight:900;}

This one sets the thickness of the lines of the font character. It allows you quite a bit more control than the HTML tag for bold <b></b>. Here's a list of the different values you may use:

bold:
Sets the font to a thick character.
bolder:
Sets the font to a thicker character.
lighter:
Sets the font to a thinner character.
normal:
Returns things back to a normal character.
100-900:
Sets the font from a thin to thick character. 400 is the same as normal, and 700 is the same as bold
p {font-variant:small-caps;}

This one converts the font to uppercase but in a smaller size than would be normal, like this paragraph. Normal as usual returns things back. Note how a normally capitalized letter like the first in a sentence appears.

p {font:italic 20pt/30pt lighter Verdana,Arial,sans-serif;}

This is our shortcut property that allows us to combine many properties into one. You may have to adjust the order that the different values appear in the declaration to get them to work right. Remember to leave a space between each value group otherwise the browser may not know where one ends and the other begins.You've probably noticed the double declaration of a size "20pt/30pt". The first is the size for the font and the second is for the line height. You'll learn about that one in the next section on text.

Support us by supporting our advertisers!



© 2004 Terry Lamrouex