Pages

Saturday, June 26, 2010

:: HTML Elements Part 4 ::

Choosing font or heading is very important in creating html pages . Both font and heading almost same but have different function and used in different situation.

HTML Headings

Headings are important in HTML documents. Headings are defined with the <h1> to <h6>.<h1> is the largest heading while <h6> is the smallest heading. This syntax requires both start /opening tag and end/closing tag. The closing tag (i.e <h1>) will be used when users do not want to use it. Use HTML headings for headings only. Do not use it to make text big or bold. Search engines use headings to index the structure and content of web pages. It is important to use headings to show the document structure. H1 headings should be used as main headings , followed by H2 headings then the less important H3 headings and so on.


For example :

<html>
<head>
<title> The fourth lesson </title>
</head>
<body>
<h1>This is H1 heading </h1>
<h2>This is H2 heading </h2>
<h3>This is H3 heading </h3>
</body>
</html>

HTML Fonts

The <font> tag specifies the font face,font size and font color of text.The end/closing tag will be used to make limit the words that will be affected by attributes of fonts.

For example

<html>
<head>
<title> The fourth lesson </title>
</head>
<body>
<font color="FFFFFF" face="verdana" size="3">This is the example using attributes of font </font>
</body>
</html>

Optional Attributes

Attribute Value Description
color rgb(x,x,x)
#xxxxxx
colorname
Deprecated. Use styles instead.
Specifies the color of text
face font_family Deprecated. Use styles instead.
Specifies the font of text
size number Deprecated. Use styles instead.
Specifies the size of text

Standard Attributes

The <p> tag also supports the following standard attributes:

Attribute Value Description
class classname Specifies a classname for an element
dir rtl
ltr
Specifies the text direction for the content in an element
id id Specifies a unique id for an element
lang language_code Specifies a language code for the content in an element
style style_definition Specifies an inline style for an element
title text Specifies extra information about an element

Using the standard attributes will make complicated. To avoid it, I will not recommend web developer to use it. But if they know how to use it, they may use it.

Tip: Use CSS to define the font face, font size, and font color of text.

Now , you already learned and know about HTML Headings and Fonts.Selamat Mencuba !!

0 comments: