HTML Note
HTML Note
A web is a page with hypertext links that cross-reference text in the Internet .A web
page is also know as HTML pages because it is coded in HTML language.
Today web pages (HTML pages ) are the standard interface of the internet.
Power of HTML
Earlier HTML pages could only hold text. However, since the boom of Internet people
have added more and more capabilities to this language.
It can now have images, animations, multimedia contents and even interactive
application.
What is HTML ?
Most HTML tags have two parts the starting tag that indicates the start of text or
formatting and the closing tag that indicates the end of text of formatting .
1. Html Stands for Hyper Text Markup language
2. HTML is not programming language , it is Markup language.
3. A markup language is a set of markup tags.
4.HTML User markup tags to describe web pages
The purpose of web browser is to red HTML documents and display them as web
pages . The browser does not display the HTML tags , but users the tgs to interpret
the content of the page.
Tags and their Properties:Most of the HTML tags have their properties. The
properties of every tag goes inside the opening tag .A tag can have any number of
properties separated by space .Most of the properties have a value. For example if
you are specifying the color property then its value will be the name of the color. A
tag with properties will be written like.
<tag property1="value" property2="value">
Tag Properties
<UL>tag
Type Type of bullet(circle,sqaure or disc)
<OL> tag
Type Type of numbering(1,A,a,I or i)
Start Beginning count of numbering (e.g.1,2,3,4 etc)
<div>tag
Align Alignment of paragraph(left,center,right or justify)
Example
<html>
<head>
<title>List </title>
</head>
<body>
<p><strong>Computer Course</strong> </p>
<ol start="5" type="i">
<li>Office Package </li>
<li>Diploma Package </li>
<li>Graphic Package </li>
<li> Accounting Package </li>
<li>Web Designer </li>
</ol>
</body>
</html>
Property Value
Location of the image(e.g."c:\windows\
SRC
circle.gif")
WIDTH Width of the image in pixel
HEIGHT Height of the image in pixel
ALT Alternate or tool-tip text
Space to the right and left of image in
VSPACE
pixels
Space to the right and left of image in
HSPACE
pixels
NAME Name of the image.
LOWSRC Location of a lower resolution image
Alignment of text with imag.
ALIGN
(top,middle,bottom etc)
Example
<html>
<head>
<title>Image</title>
</head>
<body>
<p align="center"><strong>Welcome to My site</strong></p>
<p align="center"><strong><img src="C:\scene.jpg" alt="Click here"
name="Image1" width="200" height="200" hspace="10" vspace="10"
id="Image1"></strong></p>
</body>
</html>
Property Value
<A>Tag
Name Name of the anchor
HREF Location of the file that is referenced.
TARGET Name of the window or frame to open the target file.
NOTE: Hyperlink is the part of the references another document. When you click on a hyperlink the
referenced document is opened. Anchor is a reference point inside a document that can be referenced
by a hyperlink. When<A>tag is used as anchor it doesn't have a closing tag.
In HTML a table begins with a <TABLE> tag and ends with a </TABLE>tag.
Between the <TABLE> tag there are the rows that are enclosed between <TR>and
</TR>tags. So there is one pair of <TR>and </TR>tags for each row.
Inside these rows are the cells, which are enclosed between the <TD> tag pairs
inside every row should be the same. The contents of the cell goes between the
<TD>and </TD> tags.
Example
<HTML>
<HEAD><TITLE>Table<off></TITLE>
</HEAD>
<BODY>
<table>
<tr>
<td>
Row 1, Col 1
</td>
<td>
Row 1, Col 2
</td>
</tr>
<tr>
<td>
Row 2, Col 1
</td>
<td>
Row 2, Col 2
</td>
</tr>
</table>
</BODY>
</HTML>
Contents of a cell
The context of a cell is written between the <TD>and </TD>tags.A cell of table can
contain any text,HTML,image or even another table(i.e.you can have a table inside
another table).bishal
Tables are used in web pages to arrange the layout and /or to display tabular data.
Table/cell Properties
<Table>and <TD>tag
Property Value
Width of table /cell in pixel or
WIDTH
percent
Height of table/cell in pixel or
HEIGHT
percent
BGCOLOR Background color of table/cell
BACKGROUND Background image of table/cell
Property Value
BORDER Thikness of table border in pixel
BORDERCOLOR Color of table border
CELLSPACNING Space between cells in pixel
Space between cell border and
CELLPADDING
content in pixel
Example
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY>
<table border="1" align="center" cellpadding="3" cellspacing="2" width="60%"
height="80%">
<caption>Simple Table With Formatting</caption>
<tr>
<td>
Row 1, Col 1
</td>
<td>
Row 1, Col 2
</td>
</tr>
<tr>
<td>
Row 2, Col 1
</td>
<td>
Row 2, Col 2
</td>
</tr>
<tr>
<td colspan="2" rowspan="2" align="center" valign="center">
This is a double-width, double-height cell with centered contents.
</td>
</tr>
</table>
</BODY>
</HTML>
Forms are used in a web page to collect information form the user .Generally user
cannot write or edit a web page in the browser but in a form he can type and enter
data,which can be collect by the web site owner.
For example a from can be used to accept the username and password of a user to
log him onto the system or to take his details for any other purpose.
<INPUT>Tag
From Element Description
Type
Text Box Text Field where the user can enter any text
Password Box Password Field where the user can enter password
Field where the user can enter multiple line of
Text Area Textarea
text
Filed where the user can check one or more of
Check box Checkbox
available option
Filed where the user can select any one of
Radio Button Radio
available option
Button Button Command buttton used to enter a command
Submit Button Submit Command button used to submit the form
Reset Button Reset Command button used to reset the form
Drop Down Box Filed where the user can select an item from the
drop down menu
Field where the user can select one or more
List Box
items from a list
Example
<HTML>
<HEAD>
<TITLE>Form Page</TITLE>
</HEAD>
<BODY>
<form>
Full Name:<INPUT TYPE="text" NAME="name"><br>
Gender:<INPUT type="radio" name="gender" value="male">Male<input
type="radio" name="Gender" value="female">Female<br>
Age Group:<select name ="age">
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
</select>
<Input type="submit" value="submit form"<input type="reset" value="reset
From">
</form>
</body>
</html>
<FORM>Tag properties
Property Value
NAME Name of the Form
How the form data will be
METHOD
sent(Get or Post)
The script or program file that
ACTION
will handle the form data
Property Value
NAME Name of the Field
Width of field in number of
SIZE
characters
Themaximum number of
MAXLENGTH character allowed (Including
space)
Property Value
NAME Name of the Button(optional)
VALUE Text on the button face
Property Value
NAME Name of the field
VALUE value of pass
<Select> Tag
Property Value
NAME Name of the field
SIZE Number of lines in the list box .
<option>Tag
Property Value
Value to be passed when
VALUE
selected
Doesnot have a value,appears
SELECTED
selected initially
Text Area<textarea></textarea>
Property Value
NAME Name of the field
Height of the field in number of
ROWS
line
Width of the field in number of
COLS
characters
Type of text wrapping[off,virtual
WRAP
or physical]
Frame
Until now watch web page when opened takes over the entire browser screen. The
browser screen could not be split into separate(unique) sections, showing different
but related information.
The HTML tags that divide a browser screen into two or more HTML recognizable
unique region is the <FRAMESET></FRAMESET> tags. Each unique region is called a
frame. Each frame can be loaded with a different document and hence, allow
multiple HTML documents to be seen concurrently.
The HTML frame is a powerful feature that enables a web page to be broken into
different unique section that, although related ,operate independently of each other.
The splitting of a browser screen into frames is accomplished with the <FRAMESET>
and </FRAMESET> tags embedded into the HTML document .The
<FRAMESET></FRAMESET>tags require one of the following two attributes
depending on whether the screen has to be divided into rows and columns.
ROWS This attribute is used to divide the screen into multiple rows. It
can be set equal to a list of values. Depending on the require
size of each row. The values can number of pixel, percentage
of screen resolution and the symbol of * which indicates the
remaining space of the screen
COLS This attribute is used to divide the screen into multiple
columns. It can be set equal to a list of values. Depending on
the require size of each Columns. The values can number of
pixel, percentage of screen resolution and the symbol of *
which indicates the remaining space of the screen
Example
<FRAMESET ROWS="33%,33%,33%>
</FRAMESET>
<FRAMESET COLS="50%,50%">
</FRAMESET>
</FRAMESET>
Example
<FRAMESET ROWS="30%,*">
<FRAMESET COLS="50%,50%">
<FRAME SRC="file1.htm">
<FRAME SRC="file2.htm">
</FRAMESET>
<FRAMESET COLS="50%,50%">
<FRAME SRC="file3,htm">
<FRAME SRC="file4.htm">
</FRAMESET>
</FRAMESET>