Web Module 1
Web Module 1
Origins
i)Tim Berners Lee and his group proposed a new protocol for
the Internet
ii. The proposed new system was designed to allow a user
anywhere on the Internet to search for and retrieve
documents from the databases on any number of different
document-serving computers.
iii. The system used hypertext, which is text with embedded
links to text in other documents to allow non sequential
browsing of textual material.
iv. The units of web are referred as pages, documents and
resources.
v. Web is merely a vast collection of documents, some of which
are connected by links.
vi. These documents can be accessed by web browsers and are
Web or Internet
• It is important to understand that the Internet
and the Web is not the same thing.
• The Internet is a collection of computers and
other devices connected by equipment that
allows them to communicate with each other.
• The Web is a collection of software and
protocols that has been installed on most, if
not all, of the computers on the Internet
Web browsers
<tr>
<td><center>01</center></td>
<td bgcolor="red">Shree</td>
<td>MCA001</td>
<td>Mangalore</td>
</tr>
<tr>
<td><center>02</center></td>
<td bgcolor="green">Ram</td>
<td>MCA003</td>
<td>Banglore</td>
</tr>
<tr>
<td><center>03</center></td>
<td bgcolor="pink">Kishna</td>
<td>MCA003</td>
<td>Mysure</td>
</tr>
</body>
<!DOCTYPE html>
<html>
<head>
<h1>The table element</h1>
</head>
<body>
<caption>student Details</caption>
<h2> <table align="center" border="10" cellspacing="10" cellpadding="10"></h2>
<col span="1" style="background-color:red">
<col style="background-color:yellow">
<col style="background-color:green">
<col style="background-color:pink">
<tr>
<th>Sl.no</th>
<th>Name</th>
<th>Roll number</th>
<th>Address</th>
</tr>
<tr>
<td><center>03</center></td>
<td>Kishna</td>
<td>MCA003</td>
<td>Mysure</td>
</tr>
</body>
</html>
Progress
• The <progress> tag represents the completion
progress of a task.
• Attribute
Example
<!DOCTYPE html>
<html>
<body>
</body>
</html>
Media Tags
• The media attribute specifies what
media/device the linked document is
optimized for.
• This attribute is used to specify that the target
URL is designed for special devices (like
iPhone) , speech or print media.
• This attribute can accept several values.
Media Tag Applies to
• The media attribute can be used on the
following elements:
1. A link with a media attribute: Example
2. An image map, with a clickable area: Example
3. Link Example: Two different style sheets for
two different media types (screen and print)
4. Source Example :Use of the media attribute
5. Style Example: Specify the style to use for print
Video tag
• The <video> tag is used to embed video content in a
document, such as a movie clip or other video streams.
• The <video> tag contains one or more <source> tags with
different video sources. The browser will choose the first
source it supports.
• The <source> tag is used to specify multiple media resources
for media elements, such as <video>, <audio>, and <picture>.
• The text between the <video> and </video> tags will only be
displayed in browsers that do not support the <video>
element.
• There are three supported video formats in HTML: MP4,
WebM, and OGG.
Audio tag
• The <audio> tag is used to embed sound content in
a document, such as music or other audio streams.
• The <audio> tag contains one or more <source>
tags with different audio sources. The browser will
choose the first source it supports.
• The text between the <audio> and </audio> tags
will only be displayed in browsers that do not
support the <audio> element.
Forms
• The <form> Element
• The HTML <form> element is used to create
an HTML form for user input:
• The <form> element is a container for
different types of input elements, such as: text
fields, checkboxes, radio buttons, submit
buttons, etc.
The <input> Element
• The HTML <input> element is the most used
form element.
• An <input> element can be displayed in many
ways, depending on the type attribute.
Text Fields
• The <input type="text"> defines a single-line input field for text
input.
Example:
<h2>HTML Forms</h2>
<form action="/action_page.php">
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname" value=" "><br>
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname" value=" "><br><br>
<input type="submit" value="Submit">
</form>
<p>If you click the "Submit" button, the form-data will be sent to a page called "/action_page.php".</p>
</body>
</html>
The <label> Element
• The <label> tag defines a label for many form
elements.
• The <label> element is useful for screen-
reader users.
Radio Buttons
• The <input type="radio"> defines a radio button.
• Radio buttons let a user select ONE of a limited number of choices.
Example:
<h2>Radio Buttons</h2>
<form>
<input type="radio" id="html" name="fav_language" value="HTML">
<label for="html">HTML</label><br>
<input type="radio" id="css" name="fav_language" value="CSS">
<label for="css">CSS</label><br>
<input type="radio" id="javascript" name="fav_language" value="JavaScript">
<label for="javascript">JavaScript</label>
</form>
Checkboxes
• The <input type="checkbox"> defines a checkbox.
• Checkboxes let a user select ZERO or MORE options of a limited number of
choices.
Example:
<h2>Checkboxes</h2>
<p>The <strong>input type="checkbox"</strong> defines a checkbox:</p>
<form action="/action_page.php">
<input type="checkbox" id="vehicle1" name="vehicle1" value="Bike">
<label for="vehicle1"> I have a bike</label><br>
<input type="checkbox" id="vehicle2" name="vehicle2" value="Car">
<label for="vehicle2"> I have a car</label><br>
<input type="checkbox" id="vehicle3" name="vehicle3" value="Boat">
<label for="vehicle3"> I have a boat</label><br><br>
<input type="submit" value="Submit">
</form>
The Submit Button
• The <input type="submit"> defines a button
for submitting the form data to a form-
handler.
• The form-handler is typically a file on the
server with a script for processing input data.
• The form-handler is specified in the
form's action attribute.
Example
<h2>HTML Forms</h2>
<form action="/action_page.php">
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname" value="John"><br>
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname"
value="Doe"><br><br>
<input type="submit" value="Submit">
</form>
<p>If you click the "Submit" button, the form-data will be sent to a
page called "/action_page.php".</p>
<select> tag
• The <select> element is used to create a drop-down
list.
• The <select> element is most often used in a form,
to collect user input.
• To create a menu item<select>tag is used. And to
insert the item in the menu<option> tag.
• The id attribute is needed to associate the drop-
down list with a label.
• The <option> tags inside the <select> element define
the available options in the drop-down list.
Example
<h1>The optgroup element</h1>
<form action="/action_page.php">
<label for="cars">Choose a car:</label>
<select name="cars" id="cars">
<optgroup label="Swedish Cars">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
</optgroup>
<optgroup label="German Cars">
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</optgroup>
</select>
<br><br>
<input type="submit" value="Submit">
</form>
Text area
• The <textarea> tag defines a multi-line text input control.
• The <textarea> element is often used in a form, to collect
user inputs like comments or reviews.
• A text area can hold an unlimited number of characters,
and the text renders in a fixed-width font (usually
Courier).
• The size of a text area is specified by
the cols and rows attributes (or with CSS).
• The id attribute is needed to associate the text area with
a label.
Example
<h1>The textarea element</h1>
<form action="/action_page.php">
<p><label for="hi">Text area element</label></p>
<textarea id="hi" name="w3review" rows="4" cols="50">welcome to ajiet.
and here web technology class is going on</textarea>
<br>
<input type="submit" value="Submit">
</form>
<p>Click the "Submit" button and the form-data will be sent to a page on
the
server called "action_page.php".</p>
Form action attribute
• The form action attribute specifies where to send the
form-data when a form is submitted.
• This attribute overrides the form's action attribute.
example
<!DOCTYPE html>
<html>
<body>
</body>
</html>
<!DOCTYPE html> Registration form
<body><head>
<title> Complete Form</title>
</head>
<body><h1>Registration Form</h1>
<form action="">
<p><label>Enter your email id:
<input type="text"name="myname"size="24"maxlength="25"/>
</label></p>
<p>
<label>Enter the password:
<input type="password"name="mypass"size="20"maxlength="20"/>
</label>
</p>
<p>Sex</p>
<p><label><input type="radio" name="act"value="one"/>Male</label>
<label><input type="radio" name="act"value="two"/>Female</label></p>
<p>Whichof the following Accounts do you have?</p>
<p><label><input type="checkbox" name="act"value="one"/>Gmail</label>
<label><input type="checkbox" name="act"value="two"/>Facebook</label>
<label><input type="checkbox" name="act"value="three"/>Twitter</label>
<label><input type="checkbox" name="act"value="four"/>Google+</label></p>
<p>AnySuggestions?</p>
<p><textarea name="feedback"rows="5"cols="100">
</textarea>
</p><p>Click on Submit if you want to register</p>
<p><input type="SUBMIT"value="SUBMIT"/>
example
<html>
<head>
<title>To Demonstrate Horizontal Frames using rows
Attribute</title>
</head>
<frame setrows="*,*">
<frame src="C:\Users\USER\Desktop\1.jpg"/>
<frame src="C:\Users\USER\Desktop\1.jpg"/>
</frameset>
</html>
Frames