CSS Font-Weight Property

In this chapter you will learn:
About font-weight property
Values of this property
Example of this property
CSS font-weight property is used to specify the thickness or thinness of the font. It is also used to specify the lightness and darkness of character like bold, normal etc.
Values of this property-:
There are some values of font-weight property which are given for your better guide and knowledge-
Value Description
normal This value specify the default font/character
lighter Specify lighter font
bold Specify thick font
bolder Specify thicker font
400 Same as normal font
700 Same as bold font
initial Specify default font
inherit inherited from parent element

Example of this property-
<html>
<head>
    <title>Example of font-weight</title>
    <style type="text/css">
   #a
   {
      font-weight:normal;
   }
   #b
   {
      font-weight:bold;
   }
   #c
   {
      font-weight:400;
   }
   #d
   {
      font-weight:700;
   }
</style>
</head>
<body>
<p id="a">Example of font-weight:normal</p>
<p id="b">Example of font-weight:bold</p>
<p id="c"> Example of font-weight:400</p>
<p id="d">Example of font-weight:700</p>
</body>
</html>

Output:- example of font-weight property

Summary

In this chapter you have learned about the font-weight property so now you can use this property in your own program to change the font. Click on Next button to continue-

More Articles

 

Share your thought