Introduction to HTML
BASIC TERMS
HTML : Hyper Text Markup Language
Webpage : A simple text file created using HTML.
Website : A collection of interlinked web pages containing text, images, audio and
videos.
Web Browser : A web browser is a software used to view web pages or websites
available on the internet
● HTML documents are created in any text editor for and can be run(executed)
on any computer that has a web browser.
● HTML is compatible with most of the web browsers.
● Use any text editor to type the code and save it with ‘ filename. html’ or
‘ filename. htm’. Use a browser to display the output.
Basic structure of HTML
Purpose of tags :
<html> and </html> : This tag indicates that the document is an html file.
<head> and </head> : It includes <Title> within it, the text within <head> is
not displayed on the webpage. This is used for search engine optimization.
<title> and </title> : The content within this tag is displayed on the title bar.
<body> and </body> : This tag includes all content which is to be developed
in the web browser. Mostof the tags are included in this tag.
Classification of HTML Tags
1. Container Tags : Container Tags are also called paired tags. Container
Tags have a beginning tag and an end tag. The end tag is similar to the
beginning tag but with a ''/'' in front of it. For Example <head> </head>,
<body> </body>.
2. Empty Tags : Empty tags are stand alone tags and do not have an end tag.
<Br> is an example of singular tag/Empty tag
Text formatting elements
Text formatting is used to make a document look attractive thereby enhancing
Its appearance.
Heading levels
HTML provides six levels of heading tags. The range is from 1 to 6.
These heading levels are represented as <H1> Text content </H1>.
The <H1> tag displays text in bold and with largest heading level
whereas <H6> tag displays text in the smallest heading level.
Creating a table
A table is made up of rows and columns. A table in a web page is created by using
tag, which is a container tag.
<tr> : This tag is used to create each row of the table.
<th> : It indicates table heading. is generally used for first row column content of
the table. It displays content in the bold format.
It can be replaced with <td>
< td> : It specifies data within the table (cell content).
Inserting an image
<IMG> tag is used to insert an image within a webpage. It uses following attributes
src : It is used to specify the path of an image file. The popular extensions of
image file are png, jpg and gif.
height : Specifies height of the image in pixels.
width : Specifies width of the image in pixels.
alt : It is referred as alternate text. It specifies the description of the image.
<IMG> is a empty tag.
<IMG src="Desert.jpg" height="400" width="400" alt="Desert image">
Creating hyperlinks in a webpage
Hyperlinks are used to connect one document with another document.
In HTML, Links are created by using <a> tag.
Syntax :
<a href = ''Mypage. htm''> Click here for my page </a>
The href attribute in the above syntax is used to specify address of the file (URL)
which needs to be opened on clicking.
HTML Link colours
A hyperlink by default appears blue in colour with an underline.
It is not visited by any user.
A visited link is underlined and purple.
An active link is underlined and blue.
I
Image hyperlink :
Many websites have images as hyperlink.. Syntax :
<a href = "Mypage2.htm"><Img src = "image. gif" alt = "Click on arrow"></a>