Login

Username:

Password: 

Join us Now |  Forgot Password? | Forgot UserName?

CSS 3

Learn step by step



CSS3 Web Fonts

A CSS3 Fonts is an advance feature of CSS3 which is used to improve the web designing. With the help of CSS3 Fonts feature we can create different types of font style.

The rule for defining the Fonts is only We have to declare a name in first line of starting css properties. The font file can found in ttf(True type font) format or otf (Open type font) format.


<!DOCTYPE html>
<html>
<head>
<title>Title Name will go here</title>
<style>
.font1
{
font-family: 'Cherry Cream Soda', cursive;
font-size: 14px;
color: yellow;
line-height: 1.3em;}
.font2
{
font-family: 'Ropa Sans', sans-serif;
font-size: 14px;
color: green;
line-height: 1.3em;}
.font3
{
font-family: 'Butcherman', cursive;
font-size: 14px;
color: red;
line-height: 1.3em;}
.font4
{
font-family: 'Rochester', cursive;
font-size: 14px;
color: blue;
line-height: 1.3em;}
.font5
{
font-family: 'Open Sans Condensed', sans-serif;
font-size: 14px;
color: pink;
line-height: 1.3em; }
</style>
</head>
<body><p class="font1">THIS LINE IS CONTAINING THE DIFFERENT FONT</p>
<p class="font2">THIS LINE IS CONTAINING THE DIFFERENT FONT</p>
<p class="font3">THIS LINE IS CONTAINING THE DIFFERENT FONT</p>
<p class="font4">THIS LINE IS CONTAINING THE DIFFERENT FONT</p>
<p class="font5">THIS LINE IS CONTAINING THE DIFFERENT FONT</p>
</body></html>
Different Font Formats
TrueType Fonts (TTF)

TrueType is a font standard developed in the late 1980s, by Apple and Microsoft. TrueType is the most common font format for both the Mac OS and Microsoft Windows operating systems.

OpenType Fonts (OTF)

OpenType is a format for scalable computer fonts. It was built on TrueType, and is a registered trademark of Microsoft. OpenType fonts are used commonly today on the major computer platforms.

The Web Open Font Format (WOFF)

WOFF is a font format for use in web pages. It was developed in 2009, and is now a W3C Recommendation. WOFF is essentially OpenType or TrueType with compression and additional metadata. The goal is to support font distribution from a server to a client over a network with bandwidth constraints.

SVG Fonts/Shapes

SVG fonts allow SVG to be used as glyphs when displaying text. The SVG 1.1 specification define a font module that allows the creation of fonts within an SVG document. You can also apply CSS to SVG documents, and the @font-face rule can be applied to text in SVG documents.

Embedded OpenType Fonts (EOT)

EOT fonts are a compact form of OpenType fonts designed by Microsoft for use as embedded fonts on web pages.

CSS3 Font Descriptors
Descriptor Values Description
font-family name Required. Defines a name for the font
src URL Required. Defines the URL of the font file
font-stretch normal
condensed
ultra-condensed
extra-condensed
semi-condensed
expanded
semi-expanded
extra-expanded
ultra-expanded
Optional. Defines how the font should be stretched. Default is "normal"
font-style normal
italic
oblique
Optional. Defines how the font should be styled. Default is "normal"
font-weight normal
bold
100
200
300
400
500
600
700
800
900
Optional. Defines the boldness of the font. Default is "normal"
unicode-range unicode-range Optional. Defines the range of UNICODE characters the font supports. Default is "U+0-10FFFF"


Related Videos