Monday, April 25, 2011

HTML: Font Size


The font size depend on the value of the attribute within the <body>….</body> tag. The default value of font is 12. As the value of attribute from  -1 to +7 is used to decreasing or increasing font size. But actually HTML can display the font from 8 point to 36 point.


Example Program

<html>
<head>
            <title>Font Size</title>
</head>

<body>
            <font face="Arial" size=-2>Example</font><br>
            <font face="Arial" size=-1>Example</font><br>
            <font face="Arial">Example</font><br>
            <font face="Arial" size=+1>Example</font><br>
            <font face="Arial" size=+2>Example</font><br>
            <font face="Arial" size=+3>Example</font><br>
            <font face="Arial" size=+4>Example</font><br>
</body>
</html>

Result




















Big

This stylist property is used to declaration the font in a greater size than the normal. The default size is 12 and for the <big>….<big> tag, the value will be 14.


Program

<html>
<head>
            <title>Font</title>
</head>
<body>
            Example<br>
            <big>Example</big>
</body>
</html>


Result





























Small

This stylist property is used to declaration the font in a smller size than the normal. The default size is 12 and for the <small>….<small> tag, the value will be 10.


Program

<html>
<head>
            <title>Font</title>
</head>
<body>
            Example<br>
            <small>Example</small>
</body>
</html>


Result




















Basefont

Basefont tag is used to specify a base font for the document. The use fo basefont is the same as font. HTML 5.0 dose not support basefont tag.


Example Program

<html>
<head>
            <title>Basefont Tag</title>
</head>
<body>
            <basefont face="Arial" size=-2>Basefont-2<br>
            <basefont face="Arial" size=-1>Basefont-1<br>
            <basefont face="Arial">Basefont<br>
            <basefont face="Arial" size=+1>Basefont+1<br>
            <basefont face="Arial" size=+2>Basefont+2<br>
            <basefont face="Arial" size=+3>Basefont+3<br>
            <basefont face="Arial" size=+4>Basefont+4<br>
</body>
</html>


Result



No comments:

Post a Comment