Begin Web Programming with PHP & MySQL

Advertisements



CSS Font Properties

CSS font properties allow us to manipulate how the font will look on the webpage.

Font Face

The @font-face rule allows custom fonts to be used during development and loaded on a webpage.

Font Family

The font-family property specifies the font used for the text in an element.

Eg:
<style>
p
{
font-family:Cambria, "Hoefler Text", "Liberation Serif", Times, "Times New Roman", serif;
}
</style>
<p>Font Properties</p>

Font Size

The font-size property specifies the font size of the text in an element. It can be defined in ‘px’, ‘em’, large, small, medium.

Eg:
<style>
p
{
font-size:18px;
}
</style>
<p>Font Properties</p>

Font Style

It specifies the style of the text in an element. font-style can take values italic, oblique and normal.

Eg:
<style>
p
{
font-style:italic;
}
</style>
<p>Font Properties</p>

Font Weight

font-weight sets how thick or thin the characters in a text should be shown. It can take values bold, bolder, normal, lighter and a number among 100,200,300,400,500,600,700,800,900.

Eg:
<style>
p
{
font-weight:bold;
}
</style>
<p>Font Properties</p>