Techcss
Untitled Document

Font styling using CSS

Styling HTML fonts by CSS is a very common matter now for web design.

In CSS the font-family attribute generally contain more than one font name rather using only one. Because, if a system is not supporting the first one then second one wouldbe tried or try will follow sequentially upto the last one as mentioned in CSS.

The CSS fonts attributes are:


Font family

Font family is actually the name of the font as we get like Arial, Times New Roman, Comic Sans, Calibri, Verdana etc.

The font name should mention in quotaion for the font name is more than 1 word.


Example of a class with font attributes :
<html>
<head>
<style>
.demo{
		font-family:Verdana, Arial, Helvetica, sans-serif;
		font-size:12px;
		font-size-adjust:none;
		font-stretch:semi-expanded;
		font-style:italic;
		font-variant:small-caps;
		font-weight:normal
	  }
</style>
</head>

<body>

<div class="demo"> This is a demo text with font attributes in CSS coding. </div>

</body>

</html>
Output:

This is a demo text with font attributes in CSS coding.