Professional Documents
Culture Documents
HTML Introduction:
HTML: HTML stands for Hyper-Text Markup Language. It allows us to create web
pages. It does not include any control structure and can produce only static
content. A HTML page consists of various tags that make a web page. The
features, advantages and disadvantages of HTML page are listed below.
Features of HTML:
It is a formatting language for text and images.
It allows us to read the content nonlinearly by using hyperlinks to a file.
HTML is an application of SGML,XML and JAVA Script etc.
HTML uses markup tags to describe web pages
It is not case sensitive i.e. code can be written in small case or uppercase
letters.
All the HTML documents have “ .html ” or “.htm” extension.
HTML documents can be edited using editors such as notepad or front page.
The advantages of HTML:
It can provide online documents with headings, text, tables, lists, photos etc.
It can incorporate images and sounds with the help of HTML tags.
It facilitates Moving and layered text
It allows framed documents
It allows absolute positioning of text and image.
It facilitates to include spread sheets, video clips, sound clips and other
applications directly in their documents.
The disadvantages of HTML:
HTML can produce only static content
It does not facilitate headers, footers, footnotes.
Mathematical typesetting is difficult
It completely Browser Dependent
No tabs and other automatic character spacing.
HTML Tools:
Information and Communication Technology Page 1
The most important two basic HTML Tools are discussed below.
1.HTML Editor: It is the program that uses to create and save HTML
documents.
Text based creating a document e.g. Notepad. i.e.; the code can be written
simply in a notepad.
Start Run Notepad.
2.Web Browser: It is a piece of software which is used to view the HTML page
output.
e.g. Internet Explorer, Mozilla Firefox, Google Chrome etc.
HTML Terminology:
Some of the most commonly used terms in HTML is shown below.
1.HTML Tags: It is a piece of text that is used to identify an element , so that
browser realizes how to display its contents. Tags are always written within
angle brackets(< Tag Name>).
e.g. <HTML> tag indicates the start of an HTML document and </HTML> tag
indicates the end of an HTML document.
HTML tags can be of two types. They are:
a) Paired Tags: In this the first tag referred to as opening tag and second tag is
referred to as closing tag.
e.g. <b> and </b>, <i> and </i> etc.
b) Unpaired Tags: In this does not have any closing tag. This tags are also
known as Singular or Stand-alone tags.
e.g. <br>, <hr> etc.
2. Attribute: Attribute is the property of an HTML tag that is specified in the
opening angle brackets. It supplies additional information like color, size, style
etc. to the browser about a tag.
e.g. height, color, width, src, href, border, align, alt etc.
3.DTD: Document Type Definition. HTML is defined in terms of its DTDS. All
the details of HTML tags, entities and the related document structure are
defined in the DTDS.
4.Element: It is the component of a document structure such as a title, a
paragraph or a list.
Example:
Information and Communication Technology Page 3
<!..SAMPLE PROGRAM...>
<HTML>
<HEAD>
<TITLE> My first Page </TITLE>
</HEAD>
<BODY>
<H1> Hello HTML <H1>
</BODY>
</HTML>
This tag contains information about the document, including its title, scripts
used, style definitions and document discriptions.The portion enclosed between
<HEAD> and </HEAD> tags is called the header. It includes tags like title,
script, style, meta and so on.
An HTML document's head is enclosed by the HTML head element and can
contain some of these element definitions:
The document's title: Describes briefly what the document is about.
Style declarations: Group of class definitions (style sheets) used by other
tags to set visual characteristics.
Script functions: Set of functions declared inside the “HTML script
element” to provide functionality to the document.
Meta statements: Declared through the “HTML meta tag”, set custom
attributes and values for the document.
Global links: Defined using the “HTML link tag” designates resources
related to the actual document.
The Document Body tags: This tag encloses all tags, attributes and information
that one wants the browser to display. To use <BODY> tag, enter it below the
closing </HEAD> tag and above the closing </HTML> tag. Blocks:
Here are two major blocks of text in HTML document. They are
1. Paragraph.
2. Heading.
1. Paragraph: using paragraph, text will be displayed in a separate line. <P> is a
tag which is used to create a paragraph in a HTML page.
Information and Communication Technology Page 4
Syntax: <P align=”left”/”center”/”right”>
Text
</P>
The “ align” attribute is optional. It defines the horizontal alignment of its
content. Possible values are:
Left: Text is aligned to the left margin.
Right: Text is aligned to the right margin.
Center: Text is centered.
Justify: Text is justified to both margins.
2.Heading: The <h1> to <h6> tags are used to define HTML headings. <h1>
defines the most important heading and <h6> defines the least important
heading.
Horizontal Line Tag: The HTML <hr> tag draws a horizontal line and that may
be used as separator. This tag has a set of attributes such as align, no shade, size
and width and they are optional. The <hr> tag does not require and end tag.
<hr align="left|center|
align center right">
right
<hr size="30">
In contrast to the Semantic Based style tags , Syntactic Based style tags
allows you to tell the browser specifically how we want the text to appear on web
page.
1.<B>: The bold tag <b> is used to make text in bold format.
Syntax: <B>…..text….</B>
2.<I>: The italic tag <i> is used to make text in italic format.
Syntax: <I>…..text….</I>
3.<U>:The underline tag <u> is used to displaying the text with underline.
Syntax: <U>…..text….</U>
<html>
<head>
<title>syntactic tag</title>
</head>
<body>
<pre><strong>Note:</strong>This is
</pre>
Output:
© It Displays ©
Example Program:
<html>
<head>
<title>Escape Sequences</title>
</head>
Ampersand-&<br>
Less than-<<br>
Greater than-><br>
Quotes-"<br>
Copy-©
</body>
</html>
Output:
<Font> Tag: This tag is used to Specifies the font style, font size, and font color of
text.
Color: This attribute is used to set the color name of the text.
Font Family: This is one of the property in <font> tag, which is used to set the
format to our text.
<Html>
<head>
<title>Font tag</title>
</head>
<body>
<h2>format</h2><br>
My name is ramu<br>
</font><br>
</font>
</body>
</html>
Outpt:
Hyperlinks are used to link documents in a HTML page. Anchor tags are used to
place Hyperlinks in a HTML document. The beginning and ending of Hyperlink is
represented with Anchor tag.
i.e; <a>……….</a>
We can also navigate to some website address (or) inter document
linking with the help of Hyperlink of HTML page.
We can create clickable text, images with the Hyperlink.
Href is the attribute for the Anchor tag <a>, which specifies the
destination address of the Hyperlink. i.e; where the browser should jump
whenever the end user click on the Hyperlink.
Syntax:
Example: There are two Html pages i.e; one.html and two.html. In one.html the
website details regarding the gadgets information will be displayed and it also
displays Hyperlink, whenever the end user clicks on the Hyperlink the user has
to navigate to another page.
<head>
<title>Hyperlinks</title>
</head>
<body>
</body>
</html>
<html>
<head>
<title>Information</title>
</head>
<body>
<pre>
Raja,<br>
13-5-5,<br>
Bhimavaram.
</pre>
</body>
</html>
output:
We can also create Hyperlink which leads to move to any part of the
document by using the Inter Document Linking.
<a name=”location-name”></a>
HTML Program:
<html>
<head>
<title>Inter Document</title>
</head>
<body>
<p>
</p>
<h2>Chapter 1 </h2>
<h2>Chapter 2 </h2>
<h2>Chapter 3 </h2>
<h2>Chapter 5 </h2>
<h2>Chapter 6 </h2>
<h2>Chapter 7 </h2>
<h2>Chapter 8 </h2>
<h2>Chapter 9 </h2>
<h2>Chapter 10 </h2>
</body>
</html>
Output:
List: Lists are used to represent the information in a specific format. Lists can be
used in many situations in the designing of a webpage.
There are three types of lists available in our HTML, they are
1. Ordered List.
3. Definition List.
1. Ordered List: An Ordered list follows the specific order infront of each list
item. Different numbering schemes ,i.e; numbers, small-letter alphabets and
capital-letter alphabets can be chosen in the Ordered List.
-Type is the attribute which is used to specify certain order for the Ordered
List. The order may be numbers (or) capital letters (or) small letters.
-Start is another attribute of <ol> tag which is used to specify starting value of
the Ordered List.
Syntax:
<li>………</li>
<li>………</li>
<li>………</li>
……….</ol>
HTML Program:
<html>
<head>
<title>Ordered List</title>
</head>
<body>
<h1>Groups in BVRICE</h1>
<ol type=”1”>
<li>M.E.Cs</li>
<li>M.P.Cs</li>
<li>M.S.Cs</li>
</body>
</html>
Output:
2. Unordered List: As the name specifies Unordered List does not follows any
specific pattern. In this Unordered List also each List item is to be specified with
<li> tag.
Syntax:
<ul type=”circle”/”square”/”disc”>
<li>………</li>
<li>………</li>
<li>………</li>
……….</ul>
HTML Program:
<head>
<title>Unrdered List</title>
</head>
<body>
<h1>Courses in BVRICE</h1>
<ul type=”square”>
<li>B.Sc</li>
<li>B.Com</li>
<li>Life Science</li>
<li>M.C.A</li>
<li>M.Sc</li>
</ul>
</body>
</html>
Output:
- <dl> is the tag which is used to place a Definition List in our HTML page.
- In that <dl> tag we need to use <dt> tag which is used for heading and <dd>
tag which is used to provide the Definition for the heading.
Syntax:
<dl>
<dt>heading</dt>
<dd>……………
……………..</dd>
</dl>
HTML Program:
<html>
<head>
<title>Definition List</title>
</head>
<body>
<dl>
<dt>B.V.R.I.C.E</dt>
</dl>
</body>
</html>
Tables:
Tables in HTML page allows you to organize the information in the form
of rows and columns.HTML tables are basically used to present any information
in a tabular format. This tabular format is also known as Grid View type
information.
<table> is the tag which is used to create a table in our HTML page.
<tr></tr> is the tag which is used to create a row in the table, tr-means
table row.
<tr>……………….</tr>
<td></td> is the tag which is used to create a column in the table, td-
means table data.
<td> text </td>
We can create number of rows and columns in the table as per the
requirement.
<caption> is the tag which is used to assign name to the table.
After creating number of rows and columns wemust close the </table>
tag.
<th></th> is the tag which is used to create heading for each column.
<table>
<caption>table-name</caption>
<tr>
Information and Communication Technology Page 21
<th>column1 heding</th>
<th>column2 heding</th>
</tr>
<tr>
<td>column1 data</td>
<td>column2 data</td>
</tr>
</table>
Align , this attribute used to align our table to either left (or) right (or)
center.
For e.g: Align=”left”/”center”/”right”
Height, this attribute used to set height of the table.
For e.g: height=”400”
Width, this attribute used to set width of the table.
For e.g: width=”300”
Border, this attribute is used to set border to the table.
For e.g: border=”1”
Cellspacing, this attribute is used to set the amount of wide spaces
between cells.
Cellpadding, this attribute is used to provide the amount of white spaces
between cell and data.
For e.g: Cellspacing=”5”
Cellpadding=”5”
<caption>table-name</caption>
<tr>
<th>column1 heding</th>
<th>column2 heding</th>
</tr>
<td>column1 data</td>
<td>column2 data</td>
</tr>
And so on…………..
</table>
HTML Program:
<html>
<head>
<title>sample table</title>
</head>
<body>
<caption>II M.P.Cs</caption>
<tr>
<th>register no</th>
<th>student name</th>
<th>address</th>
</tr>
<tr>
<td>2261</td>
<td>kavya</td>
<td>BVRM</td>
</tr>
<tr>
<td>2262</td>
<td>harsha</td>
</tr>
</table>
</body>
</html>
Output:
<html>
<head>
<title>colspan example</title>
</head>
<body>
Information and Communication Technology Page 24
<table align=”left” border=”2” height=”400” width=”300”>
<caption>COLSPAN</caption>
<tr>
<th>Branch</th>
<th colspan=”3”>Group</th>
</tr>
<tr>
<td>computer science</td>
<td>electronics</td>
<td>physics</td>
<td>statistics</td>
</tr>
</table>
</body>
</html>
Output:
<html>
<head>
<title>rowspan example</title>
Information and Communication Technology Page 25
</head>
<body>
<caption>ROWSPAN</caption>
<tr>
<th>Branch</th>
<th>Group</th>
</tr>
<tr>
<td>electronics</td>
</tr>
<tr>
<td>physics</td>
</tr>
<tr>
<td>statistics</td>
</tr>
</table>
</body>
</html>
HTML Colors:
HTML colors are defined using a hexadecimal notation (HEX) for the
combination of Red, Green, and Blue color values (RGB). The lowest value that
can be given to one of the light sources is 0 (in HEX: 00). The highest value is 255
(in HEX: FF). HEX values are specified as 3 pairs of two-digit numbers, starting
with a # sign. The combination of Red, Green, and Blue values from 0 to 255,
gives more than 16 million different colors (256 x 256 x 256).
The 17 standard colors are: aqua, black, blue, fuchsia, gray,
green, lime, maroon, navy, olive, orange, purple, red, silver, teal, white, and
yellow.
bgcolor attribute:
Ex:
<html>
<body bgcolor="red">
<h1>Hello world!</h1>
</html>
When we execute the above code, the background color of the web page
changes to red.
color attribute:
The color attribute specifies the color of the text inside a <font> element.
Ex:
<html>
<body>
<font color="red">This is some text!</font>
</body>
</html>
In HTML, images are defined with the <img> tag. The img tag is
empty, which means that it contains attributes only and it has no closing tag.
To display an image on a page, we need to use the src attribute. src
stands for
“ source”. The value of the src attribute is the URL of the image we want to
display on our page.
Many browsers supports images with .gif (graphical interchange format) and
.jpg (joint photographic group)
Syntax:
<img src=”url” alt=”string” height=”n” width=”n”>
Example:
<img src=”flower.jpg” height=”30px” width=”20px”>
Src: Src means source location , in this we need to mention the path of the
image.
Alt: alt is the attribute which is used to display some text .
Height and Width: these attributes are used to set the picture height and
width with pixels format.
Align: this attribute is used to align image with
left/right/center/top/bottom.
HTML program:
<html>
<body>
</html>
Including image links: we can use images as links to other pages. To add
an image as a link just add the anchor tags <A> before the <IMG> tag and at the
end add the closing anchor </A> tag. Now include the destination file name to
the opening anchor tag by adding “href” attribute.
HTML program:
HTML program:
<html>
<body background="E:/B.Sc-
2013/JS/Examples/ShirdiSaiBaba.jpg"> <font
color=”red”>
<h3>Look: A background image!</h3>
<p>Both gif and jpg files can be used a HTML
backgrounds.</p>
<p>If the image is smaller than the page, the image will
repeat itself.</p>
</font>
</body>
Including images within table: An image can either be included in a table cell
or act as a background in a table.
2.To include images within cells: Images can be included within data cells of
the tables. For that add <IMG> attribute between the <TD> or <TH> cell tags
with proper URL specifying the source of the image.
Frames in HTML:
We can work with more than one HTML document inside a single HTML page.
Each HTML page is to be included in a main program which should use frame set
tag.
Procedure:
</frameset>
<html>
<head>
<title>first page</title>
</head>
<body>
</body>
</html>
<html>
<head>
<title>second page</title>
</head>
<body>
</body>
</html>
<html>
<head>
<title>Frames</title>
</head>
<frameset rows=”50%,50%”>
</frameset>
</html>