Fundamental of HTML
HTML
HTML is an acronym for Hyper Text
Markup language. It is the primary language used to encode documents containing
hyperlinks. It provides simple mechanisms for formulating text, creating links
and lists inserting images, embedding audio and video etc. Its first version
was released in 1991 by Tim Burners Lee, the founder of WWW.
It is an application of Standard Generalized
Markup Language (SGML), which is a standard that specifies a formal
mete-language for markup documents. Any
simple text editor such as notepad in Windows or simple Text in Macintosh can
be used to create and edit HTML files.
§
HTML documents are written using HTML
“Tags”.
§
Tags are embedded in angular brackets.
§
HTML tags are case-insensitive.
§
Tags are organized in hierarchical order.
§
Documents are linked by special tag called
anchor tags.
§
Anchor tags are also called hyperlinks.
§
HTML documents are viewed by software called
‘browser’.
ELEMENTS, ATTRIBUTE,
AND TAGS
An HTML document basically
consists of HTML elements which in turn consists of tags and attributes.
HTML ELEMENT
These are the building block of a
web page. An element consists of a tag, its attributes and content. The content
of a tag can be a simple text, or may be one or more tags or both. These are
organized in tree-like structure. The root element of a HTML document is <html> which contains all the
other elements.
HTML TAGS
Tags are codes each of which
marks up a certain region in an HTML document. A tag is written within angular
brackets (< and >) and must be properly nested. The general format of a
tag is as follow:
<tag> content </tag>
Where <tag> is the opening
tag and </tag> is the closing tag.
There are two types of tags:
§
Embedded tags: These tags have both opening
and closing tags. For e.g. italic tag ( <i> </i>
), Bold tag (<b> </b>), etc.
§
Standalone tags: These tag have only opening
tags but they do not have their
corresponding tags. For e.g. <hr> tag, used to draw horizontal line, etc.
Common HTML tags and their
functionality:
Tag
|
Meaning
|
<html>…</html>
|
Root tag
|
<body>…</body>
|
Specifies the body of an HTML document
|
<head>…</head>
|
Specifies the header
|
<p>…</p>
|
New paragraph
|
<br>
|
Insert a line break
|
<b>…</b>
|
Make the text bold
|
<i>…</i>
|
Make the text italic
|
<tt>…</tt>
|
Make the text teletype face
|
<u>…</u>
|
Make the text underlined
|
<center>…</center>
|
Aligns the text in center
|
<hr>
|
Insert a horizontal line
|
<table>…</table>
|
Inserts a table
|
<tr>…</tr>
|
Creates table row
|
<img>
|
Inserts an image
|
ATTRIBUTE
Attributes are the properties of
the tags that can be optionally be assigned values to change the default
behavior of these tags. These are placed within the starting tag. Even
Standalone tags may have attributes. Each tag has its own set of attributes.
Common attributes of body Tag:
Attribute
|
Meaning
|
Bgcolor
|
It specify background color of the document
|
Background
|
It specify background image of the document
|
Link
|
It specify the color of a not yet visited link
|
Alink
|
It represents the color of an active link
|
Vlink
|
It represents the color of a visited link
|
Text
|
It specifies the color of the enclosed text
|
BASIC STRUCTURE OF
HTML DOCUMENT
Every HTML document starts with
<html> tag. This tells the browser that it is the beginning of an HTML
document. This Tag is embedded tag, and must have the corresponding
</html> tag which inform the browser that it is the end of the HTML
document.
An HTML page has basically two
distinct logical sections: Head section specified by <head> and
</head> tags and Body section specified by <body> and </body>
tags. The structure of an HTML page looks like this:
<html>
<head>
……
</head>
<body>
……
</body>
</html>
A SIMPLE HTML PAGE
The first simple but complete
HTML document that displays a simple text “Hello World” on the screen:
<html>
<head>
<title> my first HTML page
</title>
</head>
<body>
Hello World
</body>
</html>
Comments