Unit 1
Unit 1
1. Server:
A server is a computer program or device that provides a service to another computer
program and its user, also known as the client.
The system that provides information to client
Example:
Web server sends requested web pages.
Database servers are used to store and manage databases that are stored on the server
and to provide data access for authorized users
2. Client:
The software that resides on the remote machine, communicates with the server,
fetches the information, processes it, and then displays it on the remote machine is called the client.
It initiates contact with server.
It requests service from server.
Web client implemented in browser.
The system that access the information provided by the server.
3. Protocols:
In computing, a protocol is a set of rules which is used by computers to communicate with
each other across a network. It controls or enables the connection, communication, and data transfer
between computing endpoints. The Internet Protocol Suite is the set of communications protocols
used for the Internet. : The Transmission Control Protocol (TCP) and the Internet Protocol (IP).
4. Internet:
The Internet is a global system of interconnected computer networks that use the standard
Internet Protocol Suite (TCP/IP) to serve billions of users worldwide. It is a network of networks that
consists of millions of private, public academic, business, and government networks.
5. Web Page:
A Web page is a document or single unit of information that belongs to a web site
and consists of information on that site. A Web page can contain text, video, graphics, audio files,
and links to various other web pages.
6. Website:
Collection of Webpages is called Web Site.
7. Web server:
A web server is software and hardware that uses HTTP (Hypertext Transfer Protocol) and
other protocols to respond to client requests made over the World Wide Web. The main job of a web
server is to display website content through storing, processing and delivering webpages to users.
Besides HTTP, web servers also support SMTP (Simple Mail Transfer Protocol) and FTP (File
Transfer Protocol), used for email, file transfer and storage.
Web server hardware is connected to the internet and allows data to be exchanged with other
connected devices, while web server software controls how a user accesses hosted files. The web
server process is an example of the client/server model. All computers that host websites must have
web server software.
Web servers are used in web hosting, or the hosting of data for websites and web-based
applications -- or web applications.
https://programmingtrick.com/html-
assignments
HTML Versions
Since the early days of the web, there have been many versions of HTML:
Version Year
HTML 1991
HTML+ 1993
HTML 2.0 1995
HTML 3.2 1997
HTML 4.01 1999
XHTML 1.0 2000
HTML5 2012
XHTML5 2013
HTML Tags
HTML markup tags are usually called HTML tags
HTML tags are keywords (tag names) surrounded by angle brackets like <html>
HTML tags normally come in pairs like <b> and </b>
The first tag in a pair is the start tag, the second tag is the end tag
The end tag is written like the start tag, with a forward slash before the tag name
Start and end tags are also called opening tags and closing tags
Syntax:
<tagname>content</tagname>
Tag:
i) Pair tag: tag which has both start tag and end tag
ii) Singular tag: tag which has only starting tag but no ending tag.
Html
Title
<html>
<head>
<title>This is document title</title>
</head>
<body>
</body>
</html>
Tag Description
<!DOCTYPE...> This tag defines the document type and HTML version.
This tag encloses the complete HTML document and mainly comprises of
<html> document header which is represented by <head>...</head> and document
body which is represented by <body>...</body> tags.
This tag represents the document's header which can keep other HTML tags
<head>
like <title>, <link> etc.
<title> The <title> tag is used inside the <head> tag to mention the document title.
This tag represents the document's body which keeps other HTML tags like
<body> <h1>, <div>, <p> etc. It is the visible page content. It defines main content of
the web page except the document that uses frames.
Element:
An HTML file is made of
elements. These elements are
responsible for creating web pages
and define content in that webpage.
An element in HTML usually consist
of a start tag <tag name>, close tag
</tag name> and content inserted
between them. Technically, an
element is a collection of start tag,
attributes, end tag, content between
them.
Attributes:
An attribute is used to define the characteristics of an HTML element and is placed inside the
element's opening tag.
All attributes are made up of two parts − a name and a value
The name is the property we want to set.
For example, the paragraph <p> element in the example carries an attribute whose name is
align, which we can use to indicate the alignment of paragraph on the page.
The value is what we want the value of the property to be set and always put within
quotations. The three possible values of align attribute: left, center and right
<element attribute_name="value">content</element>
<p align=”left”> This is a paragraph </p>
<!DOCTYPE html>
<html>
<head>
<title>Heading Demo</title>
</head>
<body text="blue" bgcolor="olive">
Welcome to internet and Web technology
</body>
</html>
HEADING
Used to produce section headings for an HTML document. Six different levels are provided
in html. <h1> is largest and bold and <h6> may look like normal text.
Attributes: align.
Values: left, right, center, justify
<h1>.....</h1>
<h2>.....</h2>
<h3>....</h3>
<h4>.....</h4>
<h5>..../h5>
<h6>.....</h6>
Example
<html>
<head>
<title>Heading Demo</title>
</head>
<body>
<h1 align='right'> Web programming</h1>
<h2> Web programming</h2>
<h3> Web programming</h3>
<h4> Web programming</h4>
<h5> Web programming</h5>
<h6> Web programming</h6>
</body>
</html>
Paragraph: <p>....</p>(End tag optional)
It used to denote paragraph of the text. It results in a section of text with blank space above and
below
Attribute: To align the text of paragraph: align
Values: left, right, center, justify
<html>
<head>
<title> About HTML</title>
</head>
<body>
<h1> HTML AND CSS</h1>
<p> HTML is a Hyper Text Markup Language. It has tags which describes the
contents
to be displayed</p>
<p> HTML Elements are divided into Text-level elements and block level
elements</p>
</body>
</html>
Line breaks <br>
It causes the browser to start a new line. It is an empty element. An empty element is a one
that is not allowed to contain any content.
<hr/>Horizontal rule
<!doctype html>
<html>
<head>
<title> BR and HR Demo</title>
</head>
<body>
<h1>Healthy food</h1>
<hr/ color="green">
<p> Fruits and vegetables are healthy foods</p>
<hr size=6 color="blue"/>
<h1>Unhealthy food</h1>
<p> Potato chips, chocolate and fried foods are unhealthy foods<br/>We have
to avoid eating too much of unhealthy food</p>
<hr width=”75%” size=6 color="red"/>
</body>
</html>
<!doctype html>
<html>
<head>
<title> Exercise 1</title>
</head>
<body bgcolor="aqua">
<hr/ color="red" size="6">
<h2><center>Welcome to Internet and Web Technology</center></h2>
<hr/ color="red" size="6">
<p>III B.Tech - IT : V Semester<br/>19IT5351R Internet and Web
Technology<br/>Autonomous Institution</p>
<hr/ color="olive" size="4">
</body>
</html>
pre(preformatted text)<pre>....</pre>
This tag is used to preserve the white spaces and lines in the text. Most browsers will display
the content in the pre element using monospace font.
<html>
<head>
<title> About HTML</title>
</head>
<body>
<h1> HTML AND CSS</h1>
<p> HTML is a Hyper Text Markup Language.
It has tags which describes the contents to be
displayed</p>
<pre> HTML Elements are divided into
Text-level elements
and block level elements<pre>
</body>
</html>
HTML – Formatting Tags:
Bold Text:
Text that appears within <b>...</b> element, is displayed in bold
<html>
<head>
<title>Formatting Text</title>
</head>
<body>
<p><b> Web Technology</b> is my favourite subject</p>
</body>
</html>
Italic Text:
Text that appears within <i>...</i> element is displayed in italicized
<html>
<head>
<title>Formatting Text</title>
</head>
<body>
<p><i> Web Technology </i>is my favourite subjcet</p>
</body>
</html
Underlined Text:
Text that appears within <u>...</u> element, is displayed with underline
<html>
<head>
<title>Formatting Text</title>
</head>
<body>
<p><u> Web Technology</u> is my favourite subjcet</p>
</body>
</html>
Strike Text:
<html>
<head>
<title>Formatting Text</title>
</head>
<body>
<p><strike> Web Technology </strike> is my favourite subject</p>
</body>
</html>
Monospaced Font:
The content of a <tt>...</tt> element is written in monospaced font. H owever, each letter has
the same width.
<html>
<head>
<title>Formatting Text</title>
</head>
<body>
<p><tt> Web Technology</tt> is my favourite subjcet</p>
</body>
</html>
Superscript Text:
The content of a <sup>...</sup> element is written in superscript
<html>
<head>
<title>Formatting Text</title>
</head>
<body>
<p><sup> Web Technology</sup> is my favourite subjcet</p>
</body>
</html>
Subscript Text:
The content of a <sub>...</sub> element is written in subscript
<html>
<head>
<title>Formatting Text</title>
</head>
<body>
<p><sub> Web Technology</sub> is my favourite subjcet</p>
</body>
</html>
Inserted Text:
Text that appears within <ins>...</ins> element is displayed as inserted text.
<html>
<head>
<title>Formatting Text</title>
</head>
<body>
<p><ins> Web Technology</ins> is my favourite subjcet</p>
</body>
</html>
Deleted Text:
Text that appears within <del>...</del> element, is displayed as deleted text.
<html>
<head>
<title>Formatting Text</title>
</head>
<body>
<p><del> Web Technology</del> is my favourite subjcet</p>
</body>
</html>
Larger Text:
The content of the <big>...</big> element is displayed one font size larger than the rest of
the text surrounding it
<html>
<head>
<title>Formatting Text</title>
</head>
<body>
<p><big> Web Technology</big> is my favourite subjcet</p>
</body>
</html>
Smaller Text:
The content of the <small>...</small> element is displayed one font size smaller than the
rest of the text surrounding it .
<html>
<head>
<title>Formatting Text</title>
</head>
<body>
<p><small> Web Technology</small> is my favourite subjcet</p>
</body>
</html>
Empathized
Text that appears within <em>...</em> element is displayed as emphasized text in Italics
<html>
<head>
<title>Formatting Text</title>
</head>
<body>
<p><em> Web Technology</em> is my favourite subjcet</p>
</body>
</html>
<strong>....</strong>:
Text that appears within <strong>...</strong> element is displayed in boldface
<html>
<head>
<title>Formatting Text</title>
</head>
<body>
<p><strong> Web Technology</strong> is my favourite subjcet</p>
</body>
</html>
Marked Text:
Text that appears within <mark>...</mark> element, is displayed as marked with yellow
ink.
<html>
<head>
<title>Formatting Text</title>
</head>
<body>
<p><mark> Web Technology</mark> is my favourite subject marked in yellow
color</p>
</body>
</html>
rgb(x,x,x)
color #xxxxxx Specifies the color of text
colorname
<font color="color_name|hex_number|rgb_number">
Value Description
color_name Specifies the text color with a color name (like "red")
hex_number Specifies the text color with a hex code (like "#ff0000")
rgb_number Specifies the text color with an rgb code (like "rgb(255,0,0)")
Demo
<html>
<head>
<title> About HTML</title>
</head>
<body>
<h1> HTML AND CSS</h1>
<p><font color="green" face="Comic Sans MS"> HTML is a Hyper Text Mark-
up language. It has tags which describes the contents to be displayed</font></p>
</body>
</html>
Reference color
White #FFFFFF rgb(255, 255, 255)
Silver #C0C0C0 rgb(192, 192, 192)
Gray #808080 rgb(128, 128, 128)
Red #FF0000 rgb(255, 0, 0)
Maroon #800000 rgb(128, 0, 0)
Yellow #FFFF00 rgb(255, 255, 0)
Olive #808000 rgb(128, 128, 0)
Lime #00FF00 rgb(0, 255, 0)
Green #008000 rgb(0, 128, 0)
Aqua #00FFFF rgb(0, 255, 255)
Teal #008080 rgb(0, 128, 128)
Blue #0000FF rgb(0, 0, 255)
Navy #000080 rgb(0, 0, 128)
Fuchsia #FF00FF rgb(255, 0, 255))
Purple #800080 rgb(128, 0, 128))
Font for Microsoft OS and browser
HTML – Comments
Comment is a piece of code which is ignored by any web browser.
HTML comments are placed in between <!-- ... --> tags.
<!DOCTYPE html>
<html>
<head> <!-- Document Header Starts -->
<title>This is document title</title>
</head> <!-- Document Header Ends -->
<body>
<p>Document content goes here.....</p>
</body>
</html>
HTML Entity
Images
The HTML <img> element embeds an image into the document. It is an inline element
Inserts a image into the document. <img src=” “/>.It allows animated gif also.
The <img> tag is empty, it contains attributes only, and does not have a closing tag.
Attributes:
i) src : Gives the image file. attribute specifies the URL (web address) of the image:. It
is the required attribute.
ii) alt: It displays the text when it is not possible to display the images.
<img src="monkey.jpg" alt="The little monkey is sitting on the tree">
iii) border: width of the border around the image
iv) height: height of the image in pixels
iv) width: width of the image in pixels
Demo
<html>
<head>
<title>Image</title>
</head>
<body>
<h1>A beautiful red flower </h1>
<img src="flower.jpg" height="200" width="200" />
</body>
</html>
HTML links are hyperlinks .A hyperlink is an element, text or image that can click on and
jump to another document
The HTML <a> element (or anchor element) creates a hyperlink to other web pages, files,
locations within the same page, email addresses, or any other URL.
It is used to make a link to another document.
<a href=” “>link text</a>
Attribute:
i) href : specifies url33333333333333333333333333333333 of a document to be
requested. The content of anchor can be text or image.
ii) target: It specifies where to open the linked document.
values:
_blank : opens a linked document in the new window or tab
_self : opens a linked document in the current window
_parent : opens a linked document in the parent frame
_top : opens a linked document in the full body of window
Demo.html
<html>
<head>
<title> Link</title> <body>
<h1> <font color="Blue"> III year IT </h1>
<a href ="welcome.html"><font color="green"> Click here</font></a>
</body>
</html>
welcome.html
<html>
<head>
<title> Link</title>
</head>
<body>
<h2> <font color="brown" >Welcome you all for the academic year 2018-2019</font><h2>
</body>
</html>
Link Titles
The title attribute specifies extra information about an element. The information is most often shown
as a tooltip text when the mouse moves over the element.
<html>
<head>
<title> Link</title>
</head>
<body>
<h1> <font color="Blue"> III year IT </h1>
<a href ="welcome.html" title ="web technology"> Click here</a>
</body>
</html>
Demo1
Demo2
Link.html
<html>
<head>
<title>Link</title>
</head>
<body>
<a href="information.html" >Web programming</a>
</body>
</html>
Information.html
<html>
<head>
<title>Details</title>
</head>
<body>
<h3>server side programming</h3>
<h3>client side programming</h3>
</body>
</html>
Uses of links:
Link logically related items together using links in the web page
Use of links enhances the readability of web documents
We can set colors of your links, active links and visited links using link, alink and vlink attributes of <body>
tag
Image as a Link
To use an image as a link, put the <img> tag inside the <a> tag:
Demo.htm
l</html>
<head>
<title>Image</title>
</head>
<body>
<h1>The little monkey enjoying in the forest </h1>
<a href="about.html"> <img src="index1.jpg" alt="The cute little monkey"/></a>
</body>
</html>
about.html
<html>
<head>
<title> About Monkey </title>
</head>
<body >
<h1> About Monkey ! </h1>
<p> <font color="green"> Monkeys are one of the funniest animals in nature. They
are full of curiosity and adventure, mischief and intelligence. </font></p>
</body>
</html>
Image maps
An image-map is an image with clickable areas. The <map> tag defines an image-map.
The name attribute of <map> gives the map a name so that it can be referenced. The name attribute
of the <map> tag is associated with the <img>'s usemap attribute and creates a relationship between
the image and the map.
The <map> element contains a number of <area> tags.
<area> tag defines the clickable areas in the image-map.
Attributes of area tag:
Shape: The shape of the associated hot spot.
values :
rect, which defines a rectangular region;
circle, which defines a circular region;
poly, which defines a polygon;
and default, which indicates the entire region beyond any defined shapes
href : The hyperlink target for the area. Its value is a valid URL.
Coords : A set of values specifying the coordinates of the hot-spot region.
alt : A text string alternative to display on browsers that do not display images
Demo.html
<html>
<head>
<title>Image</title>
</head>
<body>
<h1>The little monkey enjoying in the forest </h1>
<img src="index1.jpg" alt="The cute little monkey " usemap="#workmap"/>
<map name="workmap">
<area shape="circle" coords="84,44,44" alt="Monkeys eyes" href="eyes.html">
</map>
</body>
</html>
Eyes.html
<html>
<head>
<title> Monkeys eyes</title>
</head>
<body>
</html>
3.
Formatting tags
HTML elements:
HTML elements are divided into two categories: block-level elements and inline (Text level)
elements
Inline elements:
The inline element does not cause a line break (start on a new line) and does not take up the full
width of a page, only the space bounded by its opening and closing tag. It is usually used within
other HTML elements. inline elements can start anywhere in a line.
Begin within a line
Does not start a new line
An example of an inline element is the <strong> tag, which makes the font of the text content
contained within boldface. An inline element generally only contains other inline elements, or it can
contain nothing at all, such as the <br /> break tag.
Div element
The <div> element is usually used as a container for other HTML elements and to separate
them for the rest.
The <div> element is an unstyled tag, in other words, using it does not change the look of an
HTML element.
It is used to wrap the information in a document so that wrapped information can be treated as a
unit. The section of documents can be independently controlled
A <div> element is a block level element.
Attribute: align
Values: left, right, center or justify
<span> element
The <span> element can be used as a container for HTML text. But essentially, it is used to
style a certain text within a larger text element. The <span> element does not automatically style an
HTML element
<span> element is used as an inline element .
The body sections have block level and text level elements
Block level elements: It break the flow of document and start at the beginning of new line.It causes
paragraph breaks
Eg: heading, paragraph, basic text section, list, tables, horizontal ines,input
5.List:
List is the collection of elements or items. Three types of list
i) Unordered list: A bullet list
ii) Ordered list: A numbered list
iii) Definition List :A list of terms and definition for each
i)Unordered list:
The unordered list starts with <ul> tag and each list item starts with <li> tag
<ul>
<li>........ </li>
<li>........ </li>
</ul>
Attribute:
type=”disc|circle|square”
<html>
<head>
<title>unordered list</title>
</head>
<body>
<h1>Programming language</h1>
<ul type="circle">
<li> C</li>
<li>C++</li>
<li>Java</li>
</ul>
</body>
</html>
</ol>
</body>
</html>
iii)Definition list:
The list is not numbered or bulleted.<DL>....</DL> tag is used for definition list..It contains
one or more definition terms<DT>...</DT> and definition description terms<DD>....</DD>
<DL>
<DT>.....</DT>
<DD>.....</DD>
</DL>
<html>
<head>
<title>Description list</title>
</head>
<body>
<dl>
<dt>Term one</dt>
<dd>ONE</dd>
<dt>Term two</dt>
<dd>TWO</dd>
</dl>
</body>
</html>
Tables:
Tables are used to organize data into rows and columns in a web document.
It is matrix of rows and columns, in which each intersection of a row and a column is called
a cell.
HTML tables are created using <table> tag, in which <tr> defines individual table row.Data
cells conatin individual pieces of data and is defined eith <td> element in each reow.
Number of rows is determined by number of <tr>element. Number of columns is determined
by maximum number of <td> element within any row.
<thead> contains the header information such as column name
<tfoot> contains the footer information like calculation results
<tbody> contains the table body
<table>
<tr>
<td>data</td>
<td> data</td>
</tr>
<tr>
<td>data</td>
<td> data</td>
</tr>
</table>
Demo1
<html>
<head>
<title>Table</title>
</head>
<body>
<table border>
<caption>Student Table</caption>
<tr>
<th> REG NO</th>
<th> MARKS</th>
</tr>
<tr>
<td>1</td>
<td>78</td>
</tr>
<tr>
<td>2</td>
<td>87</td>
</tr>
</table>
</body>
</html>
Demo2:
Table
<html>
<head>
<title> Table</title>
</head>
<body>
<h1> Fruits</h1>
<table border="1">
<caption><strong> Price of the fruit</strong></caption>
<thead>
<th> Fruit</th>
<th> Price</th>
</thead>
<tfoot>
<th> Total</th>
<th> 100</th>
</tfoot>
<tbody>
<tr>
<td> Apple</td>
<td> $80</td>
</tr>
<tr>
<td> Orange</td>
<td> $20</td>
</tr>
</tbody>
<table>
</body>
</html>
Table heading:
Table heading can be defined using <th> tag replacing <td>.The content of <th>element is
boldface and centre horizontally.
Caption element:
define title or explanation for the table.It is shown at the top of the table.It have align
attribute.<caption align=”bottom”>Table1</caption>
<table>element attributes
Attribute
1. align : By default left. Values are left, right, center
2. border :used to put a border across a cell.<table border=”1”>.Value 0 turns off the
border.
3. cellspacing : It determines amount of space between two adjacent cell .or between side
of the cell and border of the table. By default 3 pixels.
<table border=”1” cellspacing=”4”> </table>
4. cell padding attribute: It determines the distance between cell border and content
within the cell.
5. bgcolor : specify color for whole table or just for one cell.
6. background :specify background image for whole table.
7. bordercolor, bordercolordark ,bordercolorlight :specifies colors to use borders of
the table
<tr> table row attributes
1. align: horizontal alignment for the content of table cells. value: left, right, center, justify.
2. valign: vertical alignment for the content of table cells. value: top, middle, bottom.
3. bgcolor:sets the color for the table, overriding any value set for the table.
4. bordercolor,bordercolordark,bordercolorlight:specify color to use border of the row
Table heading and table data attributes<th>and <tr>
1. colspan:merge two or more columns into a single column.
2. rowspan: merge two or more rows,<th rowspan=”3”>.
The other attributes are align, valign, bgcolor, bordercolor, bordercolordark,
bordercolorlight, height, width
<html>
<head>
<title>Table</title>
</head>
<body>
<table border="1" cellspacing="5">
<tr>
<th colspan="2">student details</th>
</tr>
<tr>
<th> REG NO</th>
<th> MARKS</th>
</tr>
<tr>
<td>1</td>
<td>78</td>
</tr>
<tr>
<td>2</td>
<td>87</td>
</tr>
</table>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>HTML rowspan Attribute</title>
</head>
<table border align=”center” >
<tr>
<th colspan="5">Number of Students</th>
</tr>
<tr>
<tr>
<td>A</td>
<td>45</td>
<td>50</td>
</tr>
<tr>
<td>B</td>
<td>45</td>
<td>50</td>
</tr>
<tr>
<td rowspan="3">IV</td>
</tr>
<tr>
<td>A</td>
<td>45</td>
<td>50</td>
</tr>
<tr>
<td>B</td>
<td>45</td>
<td>50</td>
</tr>
</table>
</body>
</html>
Frames:
HTML Frames are used to divide our browser window into multiple sections where each section can
load separate HTML documents. we can display more than one HTML document in the same
browser window.
Each HTML document is called a frame, and each frame is independent of the others. A collection
of frames in the browser window is said to be frameset.
Frame 1 Frame2
Frame3
The frameset element holds one or more frame elements. Each frame element can hold a separate
document.
The frameset element states HOW MANY columns or rows there will be in the frameset, and HOW
MUCH percentage/pixels of space will occupy each of them.
rows: The row attribute divides the browser window of the frame horizontally
<frameset rows=”60,*”> : divides frame into two row. One row is of 60 pixels and other
row occupies remaining of the window
cols: The cols attribute divides the browser window of the frame vertically.
<frameset cols=”60,*”>: divides frame into two columns. One column is of 60 pixels and
other occupies remaining of the window.
<frameset rows=”20%,30%,50%” cols=”30%,*”> : divides frame into three row and two
column.
The size of the row and column can be integer ( pixels).integer followed by %(percentage of
total available space) and * (whatever space left).
Note: Frameset entries should always specify atleast two rows or column.
Note: HTML frames can be used to divide our browser window into multiple sections where each
section can load a separate HTML document.
Frameborder: indicates whether border will be drawn between frame cells. frameborder=0
indicates no border between frame cells
A Frameset element can contain nested FRAMESET that futher subdivide the window or it can
contain frame element that reference the url of the actual document that will be displayed in the
frame cell border: width of the border of each frame in pixels .A value 0 means no border.
Attributes
1. src :specify the file name should be loaded in the frame.
2. name : name of the frame. It is used when we create links in one frame and loads a page in
another frame.
3. noresize: By default we can resize the frame by clicking and dragging on borders of frame.
It prevents from resizing the frame.
4. scrolling: This attribute controls the appearance of scrollbars that appear on frame.
values: yes,no,auto
scrolling=”yes” (always have scrollbars)
scrolling=”no”(no scrollbar)
scrolling=”auto”(frame have scrollbar if required)
5. frameborder : specifies whether or not borders of the frame are shown.It overrides the
value given in the frameborder attribute on the <frameset> tag.
6. marignwidth : specifies left and right cell margin
7. mariginheight: specifies top and bottom cell margin
Basic Notes - Useful Tips
Note: Add the <noframes> tag for browsers that do not support frames.
Important: we cannot use the <body></body> tags together with the <frameset></frameset> tags
However, if you add a <noframes> tag containing some text for browsers that do not support frames,
we will have to enclose the text in <body></body> tags
Frame.html
<html>
<head>
<title>Frame</title>
</head>
</html>
ordered.html
<html>
<head>
<title>ordered </title>
</head>
<body>
<h1>Programming Language</h1>
<ol type="A">
<li>C</li>
<li>C++</li>
<li>Java</li>
</ol>
</body>
</html>
unordered.html
<html>
<head>
<title>unordered list</title>
</head>
<body>
<h1>programming language</h1>
<ul type="circle">
<li> C</li>
<li>C++</li>
<li>Java</li>
</ul>
</body>
</html>
i) Use of hyperlink in one frame and display the target information within the same
frame or different frame.
ii) One use of frame is writing html documents that provide navigation tools.i.e place
navigation bar in one frame and load main page into a separate frame
Demo:
Create a Frame
<html>
<head>
<title>Frames Document1</title>
</head>
<frameset cols="40%,50%">
<frame src="x.htm">
<frameset rows="25%,25%">
<frame src="y.htm">
<frame src="z.htm">
</frameset>
</html>
<html>
<head>
<title>Frames Document2</title>
</head>
<frameset cols="40%,60%">
<frame src=" a.html">
<frameset rows="20%,20%,20%">
<frame src="x.html">
<frame src="y.html">
<frame src="z.html">
</frameset>
</html>
<html>
<head>
<title>Frames Document3</title>
<head>
<frameset rows="30%,30%,30%">
<frame src="x.html">
<frame src="y.html">
<frame src="z.html">
</frameset>
</html>
<html>
<head>
<title>Frames Document4</title>
</head>
<frameset rows="50%,50%">
<frameset cols="25%,25%">
<frame src="y.html">
<frame src="z.html">
</frameset>
<frame src="x.html">
</frameset>
</html>
Frame Demo using link:
Framedemo.html
<html>
<head>
<title> frame set</title>
</head>
<frameset cols="200,*">
<frame src="menu.html" name="menupage"/>
<frame src="main.html" name="mainpage"/>
</frameset>
</html>
menu.html
<html>
<body bgcolor="yellow">
<ol>
<li> <a href="javas.html" target="mainpage"> Java script </a>
<li> <a href="ser.html" target="mainpage"> Servlet </a>
<li> <a href="php.html" target="mainpage"> php</a>
<ol>
</body>
</html>
main.html
<html>
<body bgcolor="red">
<h1> <font color="olive">Click any link to show results</font></h1>
</body>
</html>
javas.html
<html>
<head>
<title> Javascript</title>
</head>
<body bgcolor="pink>
<h1> Welcome to the tutorial of Java script</h1>
<p> <font color="blue"><b> Java script</b> is a client side programming
language</font></p>
</body>
</html>
ser.html
<html>
<head>
<title> Javascript</title>
</head>
<body color="olive">
<h1> Welcome to the tutorial of Servlet</h1>
<p> <font color="green"><b> Servlet</b> is a server side programming
language</font></p>
</body>
</html>
php.html
<html>
<head>
<title> Javascript</title>
</head>
<body bgcolor="violet">
<h1> Welcome to the tutorial of PHP</h1>
<p> <b> PHP</b> is a server side programming language>/p>
<p> Expansion of PHP is HyperText Preprocessor</p>
</body>
</html>
Framedemo.html
Clicking Javascript link : javas.html
input elements
</form>
Why forms
Web understands that a user is sometimes required to provide his own input. These types of
interaction include:
performing a search
uploading files
checkboxes
dropdowns
upload widgets
submit buttons
form Attributes
1. action: contains an address that defines where the form information will be sent.
2. method: can be either GET or POST and defines how the form information will be sent
Have two values: get: data appended at the end of url ,post: data sent on separate line of
the body
Attributes:
i) name : name of the button. If the name is supplied, then only the name and
value of button was actually clicked are sent.
ii) value :change the value of the button.
iii) disabled: To disable a button. It does not receive the input.
Demo
<html>
<head>
<title>form</title>
</head>
<body>
<h1> Sign up</h1>
<form >
<p>Enter the name:<input type="text" name="t1"/></p>
<p>Enter password:<input type="password" name="p1"/>
<p><input type="Submit" value="Sign In" />
<input type="reset" value="cancel" />
<input type="button" value="click me" />
</form>
</body>
</html>
<textarea>....</textarea> element allows user to enter multiple lines of data. The input
element is an empty element (no end tag), while textarea is not empty. Any character data placed
between start and end tag of textarea is displayed as default text in the textarea box when page is
loaded.
Attributes:
i) rows: This attribute specifies the number of visible text lines. Users should be able to
enter more lines
ii) cols: This attribute specifies the visible width in average character widths
iii) name: name of text area
Demo
<html>
<head>
<title>form</title>
</head>
<body>
<h1> Feed Back</h1>
<form >
Enter comments:<textarea rows="3" cols="30"> </textarea>
<p><input type="button" value="send"/>
</form>
</body>
</html>
D) Checkbox Checkboxes let a user: checkbox select ONE or MORE options of a limited
number of choices. Checkbox allows multiple options can be selected. Several checkboxes in a form
may share the same control name. Checkboxes (and radio buttons) are on/off switches that may be
toggled by the user. Clicking a checkbox is optional
E) Radio buttons
Radio buttons let a user select ONLY ONE one of a limited number of choices:.
The input tag specifes type attribute as “radio”.
one or more radio button have same value for their name attribute
Checked: The radio button is initially checked when the page is initially loaded. choosing
one of the radio buttons is mandatory.
<input type=”radio” name=”color” value=”red” checked/>RED
Demo
<html>
<head>
<title>form</title>
</head>
<body>
<h1> Registeration</h1>
<form >
Select The Gender :
<p> <input type="radio" name="gend" value="MALE"/> Male
<input type="radio" name="gend" value="FEMALE"/>Female
<p><input type="submit" value="Register"/>
</form>
</body>
</html>
If we add the multiple attribute, you can provide the ability to select multiple choices.
<html>
<head>
<title>Combo or menu or listbox</title>
</head>
<body>
<form>
<h1>Select the programming language</h1>
<select name="lang" multiple>
<option value="c">C</option>
<option value="c++">c++</option>
<option value="java">Java</option>
</select>
</form>
</body>
</html>
Demo2:
<html>
<head>
<title>Registeration form</title>
</head>
<body>
<h1> Register the following details</h1>
<form action="/signup" method="POST">
<fieldset>
</html>
Demo2.html
<html>
<head>
<title>Contact Form</title>
</head>
<body>
<h2>Contact Us</h2>
<p>Please fill in this form and send us.</p>
<form action="process-form.php" method="post">
<p> Name:<sup>*</sup>
<input type="text" name="name" id="inputName">
<p> Email:<sup>*</sup>
<input type="text" name="email" id="inputEmail">
<p> Subject:
<input type="text" name="subject" id="inputSubject">
<p>Message:<sup>*</sup>
<textarea name="message" id="inputComment" rows="5"
cols="30"></textarea>
<p><input type="submit" value="Submit">
<input type="reset" value="Reset">
</form>
</body>
</html>
Demo3: The HTML <fieldset> element is used to group several controls as well as labels (<label>)
within a web form.
<html>
<head>
<title> form validation</title>
</head>
<body>
<div align="center" style="color:brown">
<form name="myform" onSubmit="validate()">
password,image,file,email,color,hidden,date,datatime,month,number,time,url,week,search
HTML Forms - The Input Element
The most important form element is the input element.
Password Field
<input type="password" /> defines a password field:
<form><input type=”password” name=”pass”/>
</form>
How the HTML code above looks in a browser:
Password:
Note: The characters in a password field are masked (shown as asterisks or circles).
Radio Buttons
<input type="radio" /> defines a radio button. Radio buttons let a
user select ONLY ONE one of a limited number of choices:
<form> <input type="radio" name="sex" value="male" />
Male<br /> <input type="radio" name="sex" value="female" />
Female </form>
Checkboxes
Script:
Client-side scripting is a computer programs on the web which are executed on the client
side by the user web browser. It defines operation to be performed on client machine.
Various web browsers are Internet Explorer, Mozilla Firefox, opera, Google chrome
Server side scripting is a computer program runs on the server to give response to the client
request. It defines operation to be performed on server machine.
The web server are IIS(Internet Information systems),Apache Tomcat
Servelt, JSP, PHP, ASP, pearl
JAVA SCRIPT
Java script is a client side which makes the web page more dynamic and interactive.
Java script is embedded directly into HTML pages to add interactivity and dynamic to
HTML page
Web browser contains a java script interpreter which process the commands written in java
script
Javascript can read and write HTML elements or change the content of HTML elements.
Introduction to Javascript:
The HTML tag <script> is used to insert a java script into a HTML page.
We can embed the JavaScript directly or indirectly in the XHTML document anywhere in the
<head>...</head> and <body>....</body>
I) Dirctly embedding
</body>
</html>
ii) Indirectly embedding: The script is written in some other file and embed the script in HTML
document.
1.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Java script</title>
</body>
</html>
first.js
document.write("Web programming");
The document.write command is a standard java script command for writing output to a page
document: object represents the XHTL document the browser currently displaying
Scripts to be executed when they are called or when an even is triggered, go in the head section
</body>
</html>
Scripts in the <body>:
</html>
Literals:
Literals are the string of character that directly represents values in the language.
variables