HTML (Hyper Text Markup Laguage) is a markup language used by web
browsers in determining how to display a web page. It is the underlying
foundation of website design. It is a combination of plain text
and tags. Tags tell browser how to display contents of page. You
use tags everytime you want to format a text, insert image or table.
Lets see a tag example. To make a text bold, bold tag <b>
is used, which has a complimentary closing tag </b>. When
these tags are wrapped around any text, it will appear bold.
<b> this is bold text </b>
Other tags used for formatting text include <i></i>
(for making text look italic) and <u></u> (makes takes
underlined). Some tags don't need complimentary closing tags, like
<br> that is used to insert a line break and <hr> which
inserts a horizontal rule.
First HTML Page:
Now that you know what tags are lets build our first html page.
The below is the code of a complete syntax of a basic HTML page.
It outputs text: Welcome to my first HMTL page!
<head><title> this is page title </title></head>
Welcome to my first HTML page!
Type above code in any text editor, save it as first.htm or first.html
and open it in any web browser. You will see Welcome text on your
browser screen. Now lets understand the role of each tag in a document.
<html></html> All HTML documents begin and end
with these tags. They tell browser that it is an HTML document.
<head></head> <head> tags encapsulate meta
information, such as the document's title, keywords and description
info that will be used by search engines.
<title></title> <title> defines title of
the document, that will be displayed in title bar of browser.
<body></body> This is body secion of document
and document's viewable contents will be inserted here.
By default your HTML document has grey or white background. Adding
background color or background image in HTML document is very easy.
To add background color in HTML document insert
bgcolor attribute in
<body> tag as below:
<body bgcolor="#XXXXXX"> where #XXXXXX
is the hex code for color.
<body bgcolor="XXXXXX"> where XXXXXX
is the name for color.
To add a green backgound to you web page put this line in your
#00FF00 is the hex code for color green. you can also use color
name 'green' :
Note that HTML is not case-sensitive.
Now lets learn how to add a background image. Simply add
attribute to <body> tag.
You can use this image as background. save it on your local disk
and test it.
You can use both background color and background image in your
document so that users can see background color while image is still
loading from server.
<body bgcolor="GREEN" background="back.gif">