|
Set the Font Family
By Stephen Bucaro
Use the font-family property to set the text font. Font family values you include
arial, courier, times, and verdana,.
<p style="font-family:times;">This Font is Times.</p>
This Font is Times.
<p style="font-family:courier;">This Font is Courier.</p>
This Font is Courier.
Note:
In html the <font face> tag was used to set the font family i.e. <font face="Arial">.
The <font> tag was deprecated in HTML 4.0 in favor of style sheets.
Note:
If the font that you specify is not installed on the users computer, a default or
substitute font will be used. This could produce unpredictable results. A web-safe
font is guaranteed to be present on allmost all computers. Try to always use a
web-safe font. The only truely web-safe fonts are arial,courier,times, and verdana,.
If you want to use a different font, always specify one of the web-safe fonts
as a second choice, as shown below.
<p style="font-family:comic sans MS,verdana;">This Font is Comic.</p>
This Font is Comic.
The examples here use in-line style. To specify the font for all paragraphs
on a webpage, you would use an embeded style block, i.e. you would paste the code
shown below into the heaad section of your webpage.
<style type="text/css">
p
{
font-family:comic sans MS,verdana;
}
</style>
|