i2tutorials

CSS font-family

CSS font-family

 

There are two types of font-family:

 

The generic-family categories:

 

Syntax:

 

font-family: family-name|generic-family|initial|inherit;

 

Values of the font-family property:

 

 

Example:

 

<!DOCTYPE html>
<html>
<head>
<style>
body{
text-align:center;
}
h1.a {
 font-family: "Times New Roman", Times, serif;
 color:Red;
}

h2.b {
 font-family: Arial, Helvetica, sans-serif;
 color:blue;
}
</style>
</head>
<body>
<h1>The font-family Property</h1>

<h1 class="a">Hello i2tutorials :) :)</h1>

<h2 class="b">Welcome to the i2tutorials</h2>

</body>
</html>

 

OUTPUT:

 

CSS font-family

 

Exit mobile version