Header Ads

Header ADS

HTML TAG STRUCTURE


HTML TAG STRUCTURE

The structure of an HTML tag is being discussed in following lines:-
  • Every HTML tag consists of a tag name, Sometimes followed by an optional list of attributes, all placed between opening and closing angle brackets ( <  and > ).

  • Tag attributes, if any come after the tag name, each separated by one or more tab, space, or return characters. Their order of appearance is not important.

  • A tag attribute's value, if any, is given after the equal sign ( = ) in quotes generally after the attribute name......
For Ex :- <A href = "http://www.netscape.com/yellowpages">

BASIC HTML TAGS

THE HTML TAGS :- 

  • The <HTML> and </HTML> tags are used to make the beginning and end of an HTML document. 

  • This tag does not have any effect on appearance of document. 

  • This tag is used to make browsers and other program know that this is an HTML document.

  • Inside the <HTML></HTML>, document's <HEAD> and <BODY> tags lie.
THE DIR ATTRIBUTE :-
This attribute of <HTML> tag specifies in which the browser should present text within the entire document.

This attribute can have values either ltr (left-to-right) or rtl (right-to-left).

By default the value of this attribute is ltr. The value rtl is used for languages like Chinese or Herbrew.

THE LANG ATTRIBUTE :- The LANG attribute of <HTML> tag specifies the language you've generally used within the document. 

As you know, these days web pages are designed in many languages ...e.g,,French, German, Italian, Hindi etc.. To specify this base language of web page, the LANG attribute is used...e.g,,,"en" is used to specify English language and "fr" is used to specify French language...e.g:- <HTML lang = en>.

THE HEAD TAG :- The HEAD tag is used to define the document header. The <HEAD> tag contain information about the document, including its title, script used , style definitions and document description. To add <HEAD> tag, we enter its between <HTML> tags.

For instance:-  

<HTML>
<HEAD>
</HEAD>
</HTML>


THE TITLE TAG :- The title element contains your document title and identifies its content in a global context. The title is typically displayed in the title bar at the top of the browser window, but not inside the window itself.

The title is also what is displayed on someone's hotlist or bookmark list , so choose something descriptive, unique, and relatively short. 

A title is also used to identify your page for search engine.

EX:- To display the web page title as " My First HTML Page"....

 
<HTML>
<HEAD>
<TITLE>My First HTML Page</TITLE>
</HEAD>
</HTML>

NOTE:- The title can be maximum 64 characters long.

THE BODY TAG :- The Second and largest part of our HTML document is the body.

The Body tag defines the documents body. It contains all the contents of an HTML document, such as text, images, lists, tables, hyperlinks etc.

The tags explained in the following sections are used within the body of your HTML document.

BACKGROUND GRAPHICS :- Newer version of web browsers can load an image and use it as a background when displaying a page. Some people like background images and some don't.

In general, if you want to include a background, make sure your text can be read easily when displayed on top of the images.

The tag to include a background image is included in the <BODY> statement as an attribute :
<BODY background = "FILENAME.gif">

EX :- To display a background of image mypic.gif on your web page.



<HTML>
<HEAD>
<TITLE>Background image </TITLE>
</HEAD>
<BODY background = "Mypic.gif">
Sample web page for example 10.2
</BODY>
</HTMl>

BACKGROUND COLOR, TEXT COLOR, LINK COLOR :- By default browsers display text in black on a grey(or white) background. However, you can change both elements if you want.

Note:- You change the color or text (by TEXT attribute) links (by LINK attribute) visited links (by VLINK attributes), and active links (by ALINK attributes) (active links are the links that are currently being clicked on ) using further attributes of the <BODY> tag...

ex:- <BODY bgcolor = '#000000' text = "#ffffff" link = "#9690cc">

EX :- To make the background appear black,text lime, links yellow, recently visited links red and selected link as cyan.

 

<HTML>
<HEAD>
<TITLE>Attributes of body tag </TITLE>
</HEAD>
<BODY bgcolor ="black" text ="lime" link="red" alink="cyan">
SAMPLE TEXT
</BODY>
</HTMl>

HEADING IN HTML (H1.....H6 TAGS) 

HTML has six levels of heading, numbers 1 through 6, with 1 being the largest. Heading are typically displayed in larger and/or bolder fonts than normal body text. The first heading in each document should be tagged <H1>.

THE SYNTAX OF THE HEADING ELEMENT IS:- <H> TEXT OF HEADING </H>

EX:- To display multiple heading in multiple forms using H1....H6 tags.



<HTML>
<HEAD>
<TITLE>Heading in HTML</TITLE>
</HEAD>
<BODY>
<H1> HEADING 1 </H1>
<H2> HEADING 2 </H2>
<H3> HEADING 3 </H3>
<H4> HEADING 4 </H4>
<H5> HEADING 5 </H5>
<H6> HEADING 6 </H6>
</BODY>
</HTMl>



No comments

Powered by Blogger.