CSS font property provides you to change your font size, font style, font-family, and lots of other things that you want to apply in your HTML page. This property shows that what do you want with text.let’s first, see the summarization of CSS font property.

  1. The font-family is used to specify the face of a font.
  2. The font-style property is used to specify the italic font.
  3. The font-variant is used to specify the effect of the small-cap of the font.
  4. The font-weight property is used to decrease or increase how bold or light font appears.
  5. The font-size property is used to specify the size of the font.
  6. The font property is used as shorthand to specify the number of other font properties.

So now,we will discuss about full description of font-properties.

1.CSS font-style property

Let’s see the example of font-style property.

<!Doctype html>
<head>
<title>
CSS Font-style Property
</title>
<style>
p
{
   font-style:italic;
}
</style>
</head>
<body>
<p>This is Your Tech Home.This is not a dummy text.</p>
</body>
</html>

This will provide following result with italic text.

font-style Example

2.CSS font-family property

Let’s see the example of font-family property.

<!Doctype html>
<head>
<title>
CSS Font-style Property
</title>
<style>
p
{
font-family:algerian;
}
</style>
</head>
<body>
<p>This is Your Tech Home.This is not a dummy text.</p>
</body>
</html>

this will provide following result.

font-family Example.

3.CSS font-variant property

Let’s see the example of CSS font-variant property.

<!Doctype html>
<head>
<title>
CSS Font-style Property
</title>
<style>
p
{
font-variant:small-caps;
}
</style>
</head>
<body>
<p>This is Your Tech Home.This is not a dummy text.</p>
</body>
</html>

This will provide following result.

Font-variant Example

4.Font-weight style Property

Let’s see the example of CSS font-weight property.

<!Doctype html>
<head>
<title>
CSS Font-style Property
</title>
<style>
p
{
font-weight:600;
}
</style>
</head>
<body>
<p>This is Your Tech Home.This is not a dummy text.</p>
</body>
</html>

This will produce following result.

Font-weight Example

5.font-size property

Let’s see the example of CSS font-size property.

<!Doctype html>
<head>
<title>
CSS Font-style Property
</title>
<style>
p
{
font-size:20pt;
}
</style>
</head>
<body>
<p>This is Your Tech Home.This is not a dummy text.</p>
</body>
</html>

this will produce following result.

font-size Example

6.Shorthand Property

<html> <head> </head> <body> <p style = "font:italic small-caps bold 15px georgia;"> Applying all the properties on the text at once. </p> </body> </html>

This will produce following result-

Shorthand font property

Share post

Leave a Reply