GiantIsland Logo

Your Ad Here

Custom Website Fonts Using Style Sheets

You can use custom fonts to style your web page text using a simple style sheet rule. It will work in most browsers. To use alternate fonts in your web page, just copy a font you want to use from your fonts folder on your PC (usually c:\\Windows\Fonts\) to a folder in your website. Next, use the following style rule to connect your font to an area of text in your web page. Make sure you use an absolute path to the font file in your web folders as shown.

<style type="text/css" media="screen">
@font-face {
font-family:'Good Times';
src:url("http://www.giantisland.com/GiantIsland/Resources/GOODTIME.TTF") format("truetype");
}
html body .newfont {font-family:'Good Times';}
</style>

<p class="newfont">This is the new font I have applied to my website!</p>

EXAMPLE BELOW:

This is the new font I have applied to my website!


Looking for great standards-based Website Products for your website? Get GiantIsland Web Products!