IMP Web Technology Notes
IMP Web Technology Notes
UNIT-I
HTML
What is HTML?
Stands for Hypertext Markup Language.
Most documents that appear on the World Wide Web were written in HTML.
HTML is a markup language, not a programming language. In fact, the term HTML is an acronym that
stands for Hypertext Markup Language.
We can apply this markup language to your pages to display text, images, sound and movie files, and
almost any other type of electronic information.
We use the language to format documents and link them together, regardless of the type of
computer with which the file was originally created.
HTML Elements
An element consists of three basic parts: an opening tag, the element's content, and finally, a closing
tag.
<p> - opening paragraph tag
Element Content - paragraph words
</p> - closing tag
Every (web) page requires four critical elements: the html, head, title, and body elements.
1. <html> Element...</html>
o <html> begins and ends each and every web page.
o Its purpose is to encapsulate all the HTML code and describe the HTML document to the
web browser.
<html></html>
2. <head> Element
o The <head> element is "next" as they say. As long as it falls somewhere between your <html>
tag and your web page content (<body>).
o The head functions "behind the scenes." Tags placed within the head element are not directly
displayed by web browsers.
o We will be placing the <title> element here.
o Other elements used for scripting (JavaScript) and formatting (CSS) will eventually be introduced
and you will have to place them within your head element.
<html>
<head>
</head>
</html>
WEB TECHNOLOGIES [J.B.INSTITUTE OF ENGINEERING AND TECHNOLOGY]
HTML Tags
o A web browser reads an HTML document top to bottom, left to right.
o Each time the browser finds a tag, it is displayed accordingly (paragraphs look like paragraphs,
tables look like tables, etc).
o Tags have 3 major parts: opening tag(s), content(s), and closing tag(s).
o Recall that a completed tag is termed an element.
<html><body>
<h1>This is heading 1</h1><h2>This is heading 2</h2><h3>This is heading 3</h3>
<h4>This is heading 4</h4><h5>This is heading 5</h5><h6>This is heading 6</h6>
</body></html>
3. Line Breaks
o Line breaks are different then most of the tags we have seen so far. A line break ends the line
you are currently on and resumes on the next line.
WEB TECHNOLOGIES [J.B.INSTITUTE OF ENGINEERING AND TECHNOLOGY]
<p>Darshan<br />
Computer<br /></p>
HTML Lists
o There are 3 different types of lists.
o A <ol> tag starts an ordered list, <ul> for unordered lists, and <dl> for definition lists.
1. <ul> - unordered list; bullets
2. <ol> - ordered list; numbers
3. <dl> - definition list; dictionary
<ol>
<li>Find a Job</li>
<li>Move Out</li>
</ol>
o Start your ordered list on any number besides 1 using the start attribute.
<ol start="4" >
<li>Buy Food</li>
<li>Get a Degree</li>
</ol>
o There are 4 other types of ordered lists. Instead of generic numbers you can replace them with
Roman numerals or letters, both capital and lower-case. Use the type attribute to change the
numbering.
<oltype="a">
<oltype="A">
<oltype="i">
<ol type="I">
</ol>
<ul>
<li>Milk</li>
<li>Chocolate</li>
</ul>
<oltype="square">
<ol type="disc">
<oltype="circle">
</ol>
<dl>
<dt><b>Fromage</b></dt>
<dd>French word for cheese.</dd>
<dt><b>Voiture</b></dt>
<dd>French word for car.</dd>
</dl>
4. HTML Nested Lists
o You can also nest one list within another, so you could make an unordered list inside a
<html>
<ol>
<li> Clear out garage</li>
<ul>
<li> Tomatoes</li>
</ul>
<li> repair fence </li>
</ol>
</html>
numbered one:
<body bgcolor=”red”>
<font color=”red”>
<body bgcolor=”rgb(72,0,0)”>
<font color=”rgb(72,0,0)”>
<body bgcolor=”#ffff00”>
<font color=”#ffff00”>
1. Font Size
o Set the size of your font with size. The range of accepted values is from 1(smallest) to
7(largest).The default size of a font is 3.
2. Font Color
o Set the color of your font with color.
3. Font Face
o Choose a different font face using any font you have installed.
HTML Code:
<html><body>
<basefont size="2" color="green"><p>This paragraph has had its font...</p>
</basefont>
</body></html>
Internal - href="#anchorname"
Local - href="../pics/picturefile.jpg"
Global - href=http://www.xyz.com/
WEB TECHNOLOGIES [J.B.INSTITUTE OF ENGINEERING AND TECHNOLOGY]
Link Targets
o The target attribute defines whether to open the page in a separate window, or to open the link
in the current browser window.
HTML Code:
target=" _blank" Opens new page in a new browser
window
Anchors
o To link to sections of your existing page a name must be given to the anchor.
o In the example below, we've created a mini Table of Contents for this page.
o By placing blank anchors just after each heading, and naming them, we can then create
reference links to those sections on this page as shown below.
o First, the headings of this page contain blank, named anchors. They look like this.
o Now create the reference links, placing the # symbol followed by the name of the anchor in the
href of the new link.
HTML – Images
o Use the <img /> tag to place an image on your web page.
WEB TECHNOLOGIES [J.B.INSTITUTE OF ENGINEERING AND TECHNOLOGY]
<imgsrc="sunset.gif" />
1. Image src
o Above we have defined the src attribute.
o Src stands for source, the source of the image or more appropriately, where the picture file is
located.
o There are two ways to define the source of an image. First you may use a standard URL.
(src=http://www.Xyz.com/pics/htmlT/sunset.gif) As your second choice, you may copy or upload
the file onto your web server and access it locally using standard directory tree methods.
(src="../sunset.gif")
o The location of this picture file is in relation to your location of your .html file.
URL Types:
Local Src Location Description
src="sunset.gif" picture file resides in same directory as .html file
2. Alternative Attribute
o The alt attribute specifies alternate text to be displayed if for some reason the browser cannot
find the image, or if a user has image files disabled.
5. Images as Links
o Images are very useful for links and can be created with the HTML below.
<a href="http://www.xyz.com/"><imgsrc="sunset.gif"></a>
HTML Forms
o A form will take input from the viewer and depending on your needs, you may store that data
into a file, place an order, gather user statistics, register the person to your web forum, or
maybe subscribe them to your weekly newsletter.
Making a Form
o <form> is main tag to build a form.
o It has a few optional attributes too. Below is an example of the form element.
o The action attribute tells the HTML where to send the collected information, while the method
attribute describes the way to send it.
Type of Input
o The main tag for collecting information from the user is <input>.
o The tag itself contains a name attribute, so that we can refer to the input by a name, and the size
of the entry box in characters.
o There are quite few different types of input to choose from:
o <input type=”text”/> this is the default input type and accepts characters and numbers into a
text box. It can also have a value attribute attached to it, which will give it an initial value.
o <input type=”password”/> this is similar to the above text box but anything that is typed cannot
be seen; instead an asterisk is printed to cover up the entry. As the name suggests, this is used
for password entry.
o <input type=”checkbox”/> this gives a box that can be toggled between checked and unchecked.
It can initially be set to one or the other with checked=”checked”.
o <input type=”radio”/> this is similar to checkbox but in group of radio buttons only one can be
selected at a time. This can also have an initial checked state on one of the radio buttons.
o <input type=”file”/>This will give a box to allow you to choose a file similar to when you open or
save files usually on your machine. It can be used to select a file on the local machine for upload
to a server.
WEB TECHNOLOGIES [J.B.INSTITUTE OF ENGINEERING AND TECHNOLOGY]
o <input type=”submit”/> this allows a form to be submitted. When pressed, the information will
be passed on for processing, usually to a script mentioned in the action attribute option of the
form.
o <input type=”image”/> this will also submit the form when selected and, like the img tag,
requires the src attribute to specify an associated image.
o <input type=”button”/> this makes a button available.
o <input type=”reset”/> this will reset the form to its initial state when selected.
o <input type=”hidden”/> this allows hidden data(not seen by the user) to be passed along with
the form.