HTML04 Create a page to show different attributes of Font tag.

By | January 9, 2018

Create a page to show different attributes of Font tag.

 

FONT Tag

HTML provides the flexibility of changing the characteristics of the font such as size, colour etc. Every browser has a default font setting that governs the default font name, size and colour. Unless you have changed it, the default is Times New Roman 12pt with the colour being black. Now with IE 6.0 (Internet Explorer) you can specify font names other than the default, such as ARIAL and COMIC SANS.

 

The syntax of the <FONT> tag with its different attributes:

<FONT FACE = “name” SIZE = n colour = #RGB >

 

The attributes are:

  1. FACE: This attribute is used to change the font style. Its value should be given as the name of the desired font. But the font name specified must be present in the system, otherwise the default-name is used by the browser. The font will only display if the user has that font installed on the computer. Arial and Comic Sans MS are pretty widely distributed with Microsoft Windows. So if you are using a Microsoft supplied operating system, these are likely to be available on your computer.

 

  1. SIZE: Font can be displayed in any of the 7 sizes:
    1. 1 – Tiny 2 – Small               3 – Regular           4 – Extra Medium            5 – Large               6 – Real Big          7 – Largest

 

  1. COLOUR: With this attribute you can change the desired font colour. The values can be specified either by using the hexadecimal format as already described, i.e., #RGB, or by the name of the colour. The hex code of the colour has been explained earlier in this unit. As shown in Figure 2.7, the value of the colour attribute in the third line has been specified as “Blue”. So the text present in thecode between the <FONT> and </FONT> tags appears in blue. By default the colour of the text is black. If we specify the text colour in the <FONT> tag then this value overrides the colour value, if any, specified in the <BODY> tag.

 Create a page to show different attributes of Font tag.

 

 

HTML_Paragraph_Source_Code

HTML_Paragraph_Page

Html code:

[codesyntax lang=”html4strict”]

<!DOCTYPE html>
<HTML>
<HEAD>
<TITLE>CSSimplified.com HTML4</TITLE>
</HEAD>
<BODY>
<FONT FACE="VERDANA" SIZE="6" COLOR="BLUE">CSSimplified Makes Life EASY!</FONT>
<P><FONT FACE="ARIAL" SIZE="8" COLOR="RED">CSSimplified Makes Life EASY!</FONT>
</P>
<P><FONT FACE="Times New Roman" SIZE="12" COLOR="GREEN">CSSimplified Makes Life EASY!</FONT>
</P>
<P><FONT FACE="Comic Sans MS" SIZE="16" COLOR="PURPLE">CSSimplified Makes Life EASY!</FONT>
</P>
</BODY>
</HTML>

[/codesyntax]

 

 

Write above code in any text editor and save by htm or html extension and Open it in any browser by double clicking the file like internetexplorer.

 

<!DOCTYPE html>

This tag defines the document type and HTML version.

 

<HTML>….</HTML>

This tag encloses the complete HTML document and mainly comprises of document header which is represented by <head>…</head> and document body which is represented by <body>…</body> tags.

 

<HEAD>….</HEAD>

This tag represents the document’s header which can keep other HTML tags like <title>, <link> etc.

 

<TITLE>CSSimplified.com HTML 4</TITLE>

The <title> tag is used inside the <head> tag to mention the document title.

 

<BODY>…</BODY>

This tag represents the document’s body which keeps other HTML tags like <h1>, <div>, <p> etc.

 

<FONT FACE=”Times New Roman” SIZE=”12″ COLOR=”GREEN”>…</FONT>

HTML provides the flexibility of changing the characteristics of the font such as size, colour etc. Every browser has a default font setting that governs the default font name, size and colour. Unless you have changed it, the default is Times New Roman 12pt with the colour being black. Now with IE 6.0 (Internet Explorer) you can specify font names other than the default, such as ARIAL and COMIC SANS.

 

The syntax of the <FONT> tag with its different attributes:

<FONT FACE = “name” SIZE = n colour = #RGB >

 

The attributes are:

a.         FACE: This attribute is used to change the font style. Its value should be given as the name of the desired font. But the font name specified must be present in the system, otherwise the default-name is used by the browser. The font will only display if the user has that font installed on the computer. Arial and Comic Sans MS are pretty widely distributed with Microsoft Windows. So if you are using a Microsoft supplied operating system, these are likely to be available on your computer.

 

b.         SIZE: Font can be displayed in any of the 7 sizes:

a.         1 – Tiny            2 – Small          3 – Regular      4 – Extra Medium       5 – Large          6 – Real Big     7 – Largest

 

c.         COLOUR: With this attribute you can change the desired font colour. The values can be specified either by using the hexadecimal format as already described, i.e., #RGB, or by the name of the colour. The hex code of the colour has been explained earlier in this unit. As shown in Figure 2.7, the value of the colour attribute in the third line has been specified as “Blue”. So the text present in the code between the <FONT> and </FONT> tags appears in blue. By default the colour of the text is black. If we specify the text colour in the <FONT> tag then this value overrides the colour value, if any, specified in the <BODY> tag.

 

<P>…</P>

The HTML <p> tag defines a paragraph of text.

 

The <!DOCTYPE> Declaration

The <!DOCTYPE> declaration tag is used by the web browser to understand the version of the HTML used in the document. Current version of HTML is 5 and it makes use of the following declaration:

<!DOCTYPE html>

There are many other declaration types which can be used in HTML document depending on what version of HTML is being used. We will see more details on this while discussing <!DOCTYPE…> tag along with other HTML tags.

Note:- To understand program for sequence in detail Please SEARCH numerically example: HTML01, HTML02, etc.