How do I use the webfonts?

Webfonts are supported by all major browser platforms but not all in the same way. There are currently four different font formats that must be included in order to target all browsers. This includes TTF, WOFF, EOT and SVG.

1. Upload your webfonts

You must upload your webfont kit to your website. They should be in or near the same directory as your CSS files.

2. Include the webfont stylesheet

A special CSS @font-face declaration helps the various browsers select the appropriate font it needs without causing you a bunch of headaches. Learn more about this syntax by reading the Fontspring blog post about it. The code for it is as follows:

	font-family: 'MyWebFont';
	src: url('WebFont.eot');
	src: url('WebFont.eot?#iefix') format('embedded-opentype'),
	     url('WebFont.woff') format('woff'),
	     url('WebFont.ttf') format('truetype'),
	     url('WebFont.svg#webfont') format('svg');

We've already gone ahead and generated the code for you. All you have to do is link to the stylesheet in your HTML, like this:

<link rel="stylesheet" href="stylesheet.css" type="text/css" charset="utf-8" />

3. Modify your own stylesheet

To take advantage of your new fonts, you must tell your stylesheet to use them. Look at the original @font-face declaration above and find the property called "font-family." The name linked there will be what you use to reference the font. Prepend that webfont name to the font stack in the "font-family" property, inside the selector you want to change. For example:

p { font-family: 'MyWebFont', Arial, sans-serif; }

4. Test

Getting webfonts to work cross-browser can be tricky. Check other documentation here for more info about troubleshooting webfonts.


Interested in a deal too good to refuse?

Perron No1 mini

Perron No1

Perron No3 Light mini

Perron No3 Light

Perron No1 Shade mini

Perron No1 Shade

Perron No3 mini

Perron No3

Perron No2 mini

Perron No2

Perron No3 Bold mini

Perron No3 Bold

Perron No2 Italic mini

Perron No2 Italic

Z Y M m  Perron Fontforecast 7 Fonts for only $69.00 $6.90 Ends Oct 31st


See all the deals on Fontspring!