Using Font Styles: Font, Font Size , Font Weight, Font Style Here are some of the properties you can use with fonts: -
font-family specifies a font, such as Arial or Helvetica. You can list alternative fonts in case the host computer doesn't support your first choice. To do that, specify font names as a comma-separated list, like this: {font-family: Arial, Helvetica} . -
font-style indicates whether the text is to display using a normal, italic, or oblique face. -
font-variant indicates whether the text is to display using the normal letters for lowercase characters or using small capitals instead. -
font-weight specifies the boldness or lightness of the characters. -
font-stretch specifies whether text should be expanded. -
line-height specifies the height of a line. -
font-size refers to the size of a font. Here's an example using some of these style attributes to display italic, bold, and underlined text: (Listing 21-05.html on the web site) <HTML> <HEAD> <TITLE> Text Styles </TITLE> <STYLE> P {font-size:12pt; font-style:italic; font-family: Arial; text-align:center} </STYLE> </HEAD> <BODY> <H1> Text Styles </H1> <P> Here is some <SPAN >bold</SPAN> and <SPAN > underlined</SPAN> text. </P> </BODY> </HTML> |