H I O X INDIA
FREE CSS Tutorial
Google
Web hscripts.com
 HOME  ||  Scripts  ||  Purchase  ||  Tutorials  ||  Images  ||  Tools  ||  Directories 
  :-)  Send Page   :-)   Feedback   :-)   Register   :-)   Links   :-)   Support   :-)   Bookmarks :-)  
 Forums   Hosting   Internet Stats   Easy Calculation   FUN Games 

CSS Topics
Introduction
Types
Background Properties
Text Properties
Font Properties
BOX Properties
Border Properties
Margin Properties
Padding Properties
Special Topics
Ask Your Doubts
Feedback





CSS Font Size


Topic

How to set the font size in html using style sheet?



Explanation

Property: Font Size

Usage:
font-size: xx-small;
font-size: x-large;
font-size: larger;
font-size: smaller;
font-size: 10px;
font-size: 80%;

Definition:
This size of the font can be controlled using this parameter. The values can be set in three modes.
a)Absolute Size.
b)Relative Size.
c)Length - in percentage / pixels / points.
It takes the following values.
a)Absolute : The following absolute values can be used. xx-small or x-small or small or large or x-large or xx-large or medium.
b)Relative : The following relative values can be used. larger or smaller
c)Length : In percentage (e.g 34%) or pixels (e.g: 20px) or points (e.g: 20).

Example 1:
<div style="font-size: xx-small;">testing font size</div>

Result:
testing font size


Example 2:
<div style="font-size: x-large;">testing font size</div>

Result:
testing font size


Example 3:
<div style="font-size: larger;">testing font size</div>

Result:
testing font size


Example 4:
<div style="font-size: smaller;">testing font size</div>

Result:
testing font size


Example 5:
<div style="font-size: 20px;">testing font size</div>

Result:
testing font size


Example 6:
<div style="font-size: 200%;">testing font size</div>

Result:
testing font size








A Note
CSS - Cascading Style Sheets can be used along with html tags as explained in this site. This simple CSS will help you to create much elegant and neat html web pages. This does not need any additional softwares or codings. All web browser are capable of handing CSS codes.

Note 2: If required you can using <span> instead of <div> tags. div tag will start and end on new lines. span will not exceed the tag area.


privacy policy     license     sitemap
© 2004-2005 HIOX INDIA - hioxindia.com