neoncentric: webdesign | webdevelopment | search engine optimization

Browsing all articles tagged with " Fonts"

CSS3: Non-Standard Web Fonts

Jan 28, 2011   //   by Javier   //   CSS  //  No Comments

Believe it or not, but Non-Standard Web Fonts was first implemented in Internet Explorer 5. The @font-face rule is now a standard in CSS3. The syntax is as follows:

@font-face {
        font-family: Softpedia-Font;
        src: url('Andale Mono.ttf');
}

This will make the user’s browser access the given URL and download the given font to be employed inside that page. Currently, the CSS3 standard will support the OTF, TTF and EOT font types.

If a weighted or italic version of the font is needed, that form of the font-family must be included in the rule, as well as in a separate declaration, as follows:

@font-face {
        font-family: Softpedia-Font;
        src: url('Andale Mono.ttf');
        font-weight: bold;
}

Finally you need to address your font, like:

p.funky {
        font-family: Softpedia-Font;
}