Thursday, June 25, 2009

HTML A Hypertext Markup Language

HTML A Hypertext Markup Language

An introductory tutorial of HTML for those who want to learn how to create Web pages and their own websites. Even a child can make his own web pages or even his own website by using HTML.

HTML is a language made for creating the web pages for the websites.

By using HTML language the even a child can make his web pages or even his own website so why not you.

Here are some facts about the HTML language:

Introduction to HTML

What is HTML?
HTML is a language made for creating the web pages for the websites.

By using HTML language the even a child can make his web pages or even his own website so why not you.

Here are some facts about the HTML language:
Why do Need HTML
As the HTML is a very easy language for creating the web pages. It can be learned in few hours or in few days. It is the basic format of the HTML file it can be displayed on mostly operating system which supports the web browser.

You do not have to worry it is all easy to make like this type of pages.


Just follow these chapters which will help you to make your own Web Pages with in some seconds.

1]Basics of HTML

What is an HTML File?
· HTML stands for Hyper Text Markup Language.
· An HTML file is a text file containing small markup tags.
· The markup tags tell the Web browser how to display the page.
· An HTML file must have an htm or html file extension
.

An HTML file can be created using any simple text editor like "Notepad" of the Microsoft Windows.

First of all let me explain the above web page and how it is created, how easily it can be created.

Basic Description of HTML File
The HTML file can be divided into the three parts:
HTML Header
HTML Body
HTML Footer

HTML Header is the top most part of the HTML file in this section of the file we define the header of file and also Title of the file can be provided.

HTML Body is the middle part of file, in this section we define all text and elements which is to displayed on web page.

HTML Footer is the end section of the file.

How To Write a HTML File?

To write a HTML file you need an text editor, open the text editor and start writing file as given below:

Steps to write a file & view the web page:

· Open the text editor (e.g. notepad).
· Write the above file in it OR copy the above file and paste it on the notepad.
· Save this file as .htm or .html file extension (e.g. .htm , .html).
· Now open the Internet Browser and open the saved file.
· Now you can see your web page.


The file starts from an tag and ends with the . tag identifies that it is an HTML file. is also called as open tag and it also need its closed tag which is . Between these tags we will define the Header of the file, so add the tag and below it write to close tag.

More to display the Title to the Web Browser use the special tag write here title . Text written between the & tag will be displayed as the header of the your web page. The important tag is tag. Whatever you want to display on the web page you must write it in between & .

HTML Tags

Tags are the reserve keywords used in the HTML file. With the help of tags we can set the format of the text and elements used in the file.

Example: Setting the font, size, color, bold, italic, Underline to the text.

In HTML language all of the files are written using tags. Even starting of the html file is done by the tag and ended with the end tag. Tags are the reserved keywords used in the HTML. They are the predefined words called tags.
· HTML tags are used to mark-up HTML elements.
· HTML tags are surrounded by the two characters
· The surrounding characters are called angle brackets.
· HTML tags normally come in pairs like and
· The first tag in a pair is the start tag, the second tag is the end tag.
· The text between the start and end tags is the element content.
· HTML tags are not case sensitive, means the same as


Some tags are discussed here:

Basic Tags
The most important tags in HTML are tags that define headings, paragraphs, body and line breaks. The basic HTML Tags are described here in the form of table so that you can remind them easily.
Basic HTML Tags
Tag Description
Defines an HTML document
Defines information about the document
</span></span></td> <td><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"><span class="Apple-style-span" style="color: rgb(255, 255, 255);">Defines the document title</span></span></td></tr> <tr valign="top" align="left" bg style="color:#002142;"> <td><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"><span class="Apple-style-span" style="color: rgb(255, 255, 255);"><body></span></span></td> <td><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"><span class="Apple-style-span" style="color: rgb(255, 255, 255);">Defines the document's body</span></span></td></tr> <tr valign="top" align="left" bg style="color:#002142;"> <td><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"><h1> to <h6></span></td> <td><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"><span class="Apple-style-span" style="color: rgb(255, 255, 255);">Defines header 1 to header 6</span></span></td></tr> <tr valign="top" align="left" bg style="color:#002142;"> <td><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"><span class="Apple-style-span" style="color: rgb(255, 255, 255);"><p></span></span></td> <td><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"><span class="Apple-style-span" style="color: rgb(255, 255, 255);">Defines a paragraph</span></span></td></tr> <tr valign="top" align="left" bg style="color:#002142;"> <td><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"><span class="Apple-style-span" style="color: rgb(255, 255, 255);"><br /></span></span></td> <td><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"><span class="Apple-style-span" style="color: rgb(255, 255, 255);">Inserts a single line break</span></span></td></tr> <tr valign="top" align="left" bg style="color:#002142;"> <td><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"><span class="Apple-style-span" style="color: rgb(255, 255, 255);"><hr /></span></span></td> <td><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"><span class="Apple-style-span" style="color: rgb(255, 255, 255);">Defines a horizontal rule</span></span></td></tr> <tr valign="top" align="left" bg style="color:#002142;"> <td><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"><span class="Apple-style-span" style="color: rgb(255, 255, 255);"><!--></span></span></td> <td><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"><span class="Apple-style-span" style="color: rgb(255, 255, 255);">Defines a comment</span></span></td></tr></tbody></table> <div align="justify"><b><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;">Description Of The Above Tags</span></b></div> <div align="justify"><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"><html>tag<b> <br /></b>This element tells a browser that this is an HTML document. This tag is defined at the top of the HTML file and at the end of file. <br /> <br />Format: <br /><html> <body>..............body of HTML.............</body></html> <br /> <br />Example: <br /><html> <body> this is my first page </body></html> <br /> <br /><head> tag <br />The head tag defines information about the document. The browser does not display the "head information" to the user. The following tags can be in the head section: <base>, <link>, <meta>, <script>, <style>, and <title>. The head tag is used between <html> and <body> tags. <br /> <br />Format:</span> <br /><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"><html> <head>.....head sections....</head><body>......body of HTML........</body></html> <br /> <br />Example: <br /><html> <head><title>Basic tag this is my first page

tag <br />Title tag defines the title of the document which appears in the Title bar of the explorer window. <br />Title tag is used in between <head> and </head> tag. because it is title tag is section of <head> tag. <br /> <br />Format: <br /><html> <head><title>Title of the Page</head><body>.....body of HTML......</body></html> <br /> <br />Example: <br /><html> <head><title>Basic tag this is my first page

tag
The body element defines the documents' body. It contains all the contents of the document (like text, images, colors, graphics etc).

Format:


Example:
Attributes
Attribute Value Description
background file_name An image to use as the background. Deprecated. Use styles instead.
bgcolor color_name The background color of the document. Deprecated. Use styles instead.
link, alink, vlink color_name Specifies the color of all the links in the document. Deprecated. Use styles instead.
text color_name Specifies the color of the text in the document. Deprecated. Use styles instead.
... Heading Tags
These tags are used to display headings in an HTML document. through these tags you can increase the size of the text. In these tags

tag defines the largest header &

defines smallest.
These tags are

,

,

,

,


Format:
.............. text..............

Example:

this is my first page

or

text

Attribute of the Tag.
Attribute of the Tag
It has only one attribute i.e. Align="value" values may be right, left, center and justified. you can use this align attribute in many tags to align the text or elements. It has only one attribute i.e. Align="value" values may be right, left, center and justified. you can use this align attribute in many tags to align the text or elements.

align value (right, center, left, justified)

.....

Paragraph Tag
This tag is used for creating the paragraph in the web page. It is used inside the body of file.


Format:

......longtext..........



Example:

This is the test of paragraph tag........



In this tag align attribute can be used.


tag
The
tag inserts a single line break. Use the
tag to enter blank lines, not to separate paragraphs. This tag has no end tag.

Format:
text........
.....text

Example:
this is a break
in the line.



tag
The
tag inserts a horizontal rule. The
tag has no end tag.

Format:
text......
......text or text......
.... text

Example:
this is the test of the hr
tag
Attribute
Attribute Value Description
align right,left,center The alignment of the horizontal rule.
size % , pixels The thickness (height) of the horizontal rule.
width % , pixels The width of the horizontal rule.
Comment Tag
The comment tag is used to insert a comment in the source code. A comment will be ignored by the browser. You can use comments to explain your code, which can help you when you edit the source code at a later date.

You can also store program-specific information inside comments. In this case they will not be visible for the user, but they are still available to the program. A good practice is to comment the text inside the script and style elements to prevent older browsers, that do not support scripting or styles, from showing it as plain text.

Format:


Example:


You might have became bored of reading so lets do some practical.

Follow these Steps:
copy this code in the new file of any text editor.
Save it with htm or html extension.
Open the Internet Browser.
Open the saved file in it.

Example:


In body tag


In body tag, background color is defined as black and textcolor is defined as the white.


this is the h1 header


this is the h2header


this is the h3 header


this is the h4 header


this is the h5 header


This is the use of "Break" tag
and you will see use of more tags


look at the use of comment tag it is good

This is the use of paragraph tag and you will see use of more tags


The effect of "hr" tag





1] Character Format Tags
These tags are used for the formatting of the text such as underline, bold, italic, font, size, color of the text.

All these character formatting Tags are defined in the table shown below:
Char Format Tag Description
Displays bold text
Displays italic text
Renders as teletype or mono spaced text
Displays underlined text
Displays emphasized text
Displays big text
Displays small text
Displays strong text
Displays subscripted text
Displays superscripted text
Defines the direction of text display
Defines the font face, size, and color of text
Tag
T
he tag is used to make the text bold.

Format:
................text.........

Tag
The tag displays the italic text.

Format:
................text.........

Tag
The tag displays the typewriter text.

Format:
................text.........

Tag
The tag displays the underlined text.

Format:
................text.........

Tag
The tag displays the emphasized text.

Format:
................text.........

Tag
The tag displays the big text.

Format:
................text.........

Tag
The tag displays the small text.

Format:
................text.........

Tag
The tag displays strong text.

Format:
................text.........

Tag
The tag displays text in subscripted format.

Format:
................text.........

Tag
The tag displays superscripted text.

Format:
................text.........

Tag
The tag defines the direction of the text.

Format:
................text.........

Tag
The tag defines the font, color, size of the text.

Format:
........text.........
Examples of the Text Formatting tags
Examples Outputs
This text is bold This text is bold
This text is strong This text is strong
This text is big This text is big
This text is emphasized This text is emphasized
This text is italic This text is italic
This text is small This text is small
This text contains subscript This text contains subscript
This text contains superscript This text contains superscript
this is underlined text this is underlined text
Here is some Hebrew text Here is some Hebrew text
You have read all the basis tags, So now lets do some practical.

Just write/copy this example on any text editor new file and save the file and open in the browser and see how it looks.

Example:


This text is bold


This text is strong


This text is big


This text is emphasized


This text is italic


This text is small


this is underlined text


This text contains
subscript


This text contains
superscript

The use of font tag

this is use of font tag




3] Output Tags
These tags are often used to display computer/programming code. You might be surprised for "how to display the text containing the spaces, line breaks, programming codes, sample text, define variable". Do not worry, because in this chapter we are going to show you how easily you can do easily.

So lets start with these tags:

Tag Description
Defines preformatted text
Defines computer code text
Defines teletype text
Defines keyboard text
Defines a variable
Defines a definition term
Defines sample computer code
.........
Tag
This is preformatted text. It preserves both spaces and line breaks. The pre tag is good for displaying computer code.

Format:
  .....text.....


Example:
 for i = 1 to  10

print i
next i


Output:
for i = 1 to 10
print i
next i

.....text ...... Tag
This tag is also used to display the computer code. But better you use
 tag.


Format:
.....text.....

.....Keyboard Input...... Tag
This tag displays the Keyboard Input.

Format:
........ Keyboard Input......

......text.... Tag
This tag displays the typewriter text.

Format:
.....text.....

....sample text... Tag
This tag displays the sample text.

Format:
.....sample text.....

computer variable
This tag defines the computer variable.

Format:
computer variable

definition term
this tag is used for definition term.

Format:
definition term
Examples of output tags
Examples Outputs
 It preserve all spaces 
It preserve all             spaces
Computer code Computer code
Keyboard input Keyboard input
Teletype text Teletype text
Sample text Sample text
Computer variable Computer variable
Definition term Definition term
Now you have learned the Output Tags so lets do some practical. Below there is a file type the same code on notepad (any text editor) and save it. now open this file in the internet browser.

Example:

Computer code


Keyboard input


Teletype text


Sample text


Computer variable



Note:
These tags are often used to display computer/programming code.




0 comments:

Post a Comment