Ads by Lake Quincy Media
| Next Tip?
Home » HTML, Tutorial

HTML-A Step Ahead Series Part III

16 November 2008 715 views One Comment
1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 4.00 out of 5)
Loading ... Loading ...

Basic Elements

Starting form the Basic Elements of the HTML

Starting from the Body tag

Body Tag:–

Syntax:– <Body>….</Body>

Type:– Container Tag End Tag is necessary.

Purpose:– This tag defines the contents of the page all other tags which will add some objects to the body will be placed here the objects may be some text, image, animation etc..

Example:– <Body>Contents of my page starts from here </Body>

Attributes:– Following are the attributes of the Body Tag

1. Leftmargin
* Value:- any valid integer
* Purpose:– To tell the browser what space you have to leave from the left side between the text and the browser boundary.
* Example:– 0,1,5,etc
o <body leftmargin=”0″>
2. RightMargin
* Value:- any valid integer
* Purpose:– To tell the browser what space you have to leave from the right side between the text and the browser boundary.
* Example:– 0,1,5,etc
* <body rightmargin=”0″>
3. TopMargin
* Value:- any valid integer
* Purpose:– To tell the browser what space you have to leave from the top side between the text and the browser boundary.
* Example:– 0,1,5,etc
o <body topmargin=”0″>
4. BottomMargin
* Value:- any valid integer
* Purpose:– To tell the browser what space you have to leave from the bottom side between the text and the browser boundary.
* Example:– 0,1,5,etc
o <body bottommargin=”0″>
5. Bgcolor
* Value:- any valid color name or the hexadecimal code
* Purpose:– To tell the browser to give the particular to the document.
* Example:– blue, #FF00F6 etc
o <body bgcolor=”pink”>
o <body bgcolor=”#ABC034″>
6. Background
* Value:- any valid path for the image with its name and extention
* Purpose:– To tell the browser to use this image as the background for the document.
* Example:– <body background=”c:\images\1.jpg”>
7. link
* Value:- any valid color name or the hexadecimal code
* Purpose:– To tell the browser to give the particular to the links of the document.
* Example:– blue, #FF00F6 etc
o <body link=”red”>
8. alink
* Value:- any valid color name or the hexadecimal code
* Purpose:– To tell the browser to give the particular to the active links of the document.
* Example:– blue, #FF00F6 etc
o <body alink=”yellow”>
9. vlink
* Value:- any valid color name or the hexadecimal code
* Purpose:– To tell the browser to give the particular to the visited links of the document.
* Example:– blue, #FF00F6 etc
o <body alink=”green”>
10. style
* Many other parameters are defined in it we will discuss it later as this attribute is common to most of the tags.

Paragraph Tag:-

Syntax: — <p>…..</p>

Purpose:– The Purpose or the utility of this tag is to make a paragraph for the body contents as we write in a word file or any other document we cerate paragraphs similarly here if we want to create a paragraph we have to create it in a tag.

Example:– <p> This is my First Paragraph </p>

Type:- This is a container Tag end tag not compulsory

Attributes:– The attributes of paragraph tag are

1. Align

* Values:- Left, Right, Center, Justify
* Purpose:- to align the text of the paragraph.
* Example :– <p align=”Right”> This is Right Aligned Para.</p>
o <p align=”center”> This is Center Aligned Para.</p>

Heading Tag:-

These are six tags we are having ranging from H1 to H6.

Syntax:– <H?>….</H?>

here ? stands for any digit between 1 to 6

Type:– Container Tag End Tag is necessary.

Purpose:– This tag defines the Headings or we can say the titles for the contents the H1 tag defines the largest heading in size the headings are bold by default

Example:– <H1>HTML TAGS</H1>

Optional Attributes:– Following are the attributes of the Heading Tag

1. Align
* Values:- Left, Right, Center, Justify
* Purpose:- to align the text of the Heading. Deprecated. Use styles instead
* Example :– <H1 align=”Right”> Heading One.</H1>

Note:–

The “align” attribute of the h1 to h6 element was deprecated in HTML 4.01.

The “align” attribute of the h1 to h6 element is not supported in XHTML 1.0 Strict DTD.

Why Use Heading Tags?

You may be wondering why heading tags are necessary at all. You could achieve the same effect by specifying a larger font or defining a css class. The main reasons are:

1. Heading tags will be recognised by browsers which don’t recognise style sheets (or use a user-defined style sheet).
2. Heading tags are used by some search engines to identify words which are more important than the rest of the page text. The theory is that headings will sum up the topic of the page, so they are counted as important keywords.
3. Heading tags make it easy to make global changes to headings. Although you could theoretically achieve this by defining a new css class, it makes more sense and tends to be easier to define a style for heading tags.

+++
Thanks and Regards
Meetu Choudhary

Popularity: 2%

Post to Twitter Tweet This Post

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

Ads by Lake Quincy Media

One Comment »

  • RD said:

    Cool Post.
    Answered My Queries

Leave your response!

You must be logged in to post a comment.

Get Adobe Flash playerPlugin by wpburn.com wordpress themes