Want to get away from ‘Web Safe’ fonts for some attractive headers AND do it without using an image? Use CSS3 font Embedding and embed a font-face!
NOTE: This article uses font file stored online and your browser may run slow or attempt to crash… sorry!
Don’t forget to subscribe to our RSS-feed follow us on Twitter follow us on Facebook![]()
![]()
![]()
@font-face is not strictly speaking ‘CSS3?; it was originally born in CSS 2 and although not appearing in CSS 2.1, CSS 3 is attempting to bring it into the standards.
In order to use a font, we first must call it using the ‘@font-face’ attribute and this must be done for each individual font we wish to use. Although I’m sure you have a few, you can download some fonts to experiment with here, at dafont.com.
CSS 3 Embedded Font Face
HELLO CSS 3 WORLD!
The above header uses the SketchRockwell font with the following CSS 3 applied to it.
CSS 3 Font Embed (Example I)
@font-face {
font-family: ‘SoftSugarplainRegular’;
src: url(‘fonts/Softplain-webfont.ttf’);
}
.fontface {
font: 40px ‘SoftSugarplainRegular’, Arial, sans-serif;;
letter-spacing: 0;
text-align:center;
}
CSS3 can render type using several font formats: “truetype” (ttf),
“opentype” (otf), “embedded-opentype” (eot) and
“scalable-vector-graphic” (svg,svgz).
HELLO CSS 3 WORLD!
We can also apply additional effects such as a Text Shadow.
CSS 3 Font Embed (Example II)
@font-face {
font-family: 'SoftSugarplainRegular';
src: url('fonts/Softplain-webfont.ttf');
}
.fontface1 {
font: 40px 'SoftSugarplainRegular', Arial, sans-serif;
letter-spacing: 0;
text-align:center;
text-shadow: 3px 3px 7px #111;
}
NOTE:For some reason, using both @font-face and text-shadow will cause problems in Google Chrome. The reason IE has been given a ‘?’ next to it for the @font-face attribute, is because it will work using the popular .eot font file…
An example for those on alternative browsers, not seeing the embedded font..
Pixel2Pixel Design RSS Feed for more daily web development tutorials and articles.


Pingback: Free creative fonts for designers
Pingback: Modern Fonts for Use in Web Projects
Pingback: Modern Fonts for Use in Web Projects
Pingback: CSS3 font Embedding in HTML – Pixel2Pixel Design
Pingback: CSS3 font Embedding in HTML