Chapter 1 HTML Webpublishing / Notes On Webpublishing and HTML Class 12 IT
Chapter 1 HTML Webpublishing / Notes On Webpublishing and HTML Class 12 IT
Web Publishing
Introduction
Frame
Frames can help to display more than one window at a same time.
Frame divide the screen in to separate window s are totally independent of each other.
<Frameset> tag to create a frame this tag is written in place of <body> tag. This tag is closed
with </frameset> tag. The <frameset> tag defines how to divide the window into frames.
Attributes of <frameset> tag1. Rows/cols- sets the number of rows or columns required to create a frame. It indicate the
amount of screen area each row/column, which will occupy.
a. The total area of all the rows and columns must be either defined in terms of
percentage. E.g. <20%,30%,50%> means first frame 20% of total size and third
frame 50% of total size.
OR
b. Relative value by using (*) sign e.g. 50%, * means first frame 50% of total size
and * means the remaining second.
OR
c. In terms of Pixels e.g. <50, *> means 50 pixels to the first frame and the
remaining space to the second frame.
<Frame> tag- is used to create frame in a frameset.
Attributes1. Src- the URL of the document to be displayed in the frame.
2. Name- it is used to assign the name to the frame.
3. Border- shows the border around the frame specifies in pixels.
4. Margin height/width- specifies height (top and bottom margin) and width (left and right
margin) in pixels.
5. Scrolling- yes scroll bars
No- no scroll bars
Auto- let the browser choose
6. No resize- prevents the user from resizing the frame window.
Programs- 1)
<html><head>
This is
This is
Frame1.html
Frame2.html
This is
<html><head>
Frame1.html
</title> </head>
This is
src=frame1.html>
<frame
Frame2.html
src=frame2.html>
</frameset>
</html>
3)
<html><head>
<title> frames </title> </head>
This is
This is
Frame1.html
Frame2.html
This is
Frame3.html
<frame src=frame1.html>
<frame src=frame2.html>
</frameset>
<frame src=frame3.html>
Top
</frameset></html>
4)
Left
Right
<html>
Bottom
<head>
<title> frames </title> </head>
<frameset rows=20,60,20>
<frame src=Top.html> </frameset>
<frameset cols=50, 50>
<frame src=Left.html>
<frame src=Right.html>
</frameset>
<frame src=Bottom.html>
</frameset>
</html>
5)
<html>
Page1
Page2
Page3
Page4
<head>
<title> frames </title> </head>
<frameset cols=50, 50>
<frame src=Page1.html>
<frame src=Page2.html>
</frameset>
<frameset rows=50, 50>
<frame src=Page3.html>
<frame src=Page4.html>
</frameset></html>
Linking FrameFor linking name and target attributes are used. In linking there is links on the left side of
browser and content is displayed on the right side while clicking on links.
StepsFirst create a frameset with 2 frames. Give name to the frames using the name attribute.
<frame src=left.html
<frame src=right.html name=abc>
The hyperlink when clicked should be displayed in the right frame which is target name.
<a href=software.html target=abc>Software</a>
<a href=hardware.html target=abc>Hardware</a>
<html>
<head>
<title>linking frames
Left page
Software
<frame src=left.html>
Hardware
Right page
<frame src=right.html
</title> </head>
name=abc>
</frameset></html>
Left Page
<html>
<head>
<title> left </title> </head>
<body>
<a href =software.html target=abc>Software</a>
<a href=hardware.html target=abc>Hardware</a>
</body></html>
There are some target names that will open the link in different frames.
Target=_self
Target=_blank
Target=_top
Target=_parent
Inline or Floating frame<iframe> tag is used to create inline frame. It displays frame along with the text and graphics on
html page. </iframe> is closing tag. It appears within <body> tag.
Attributes1. Src= the URL of the page to be displayed in the inline frame.
2. Height/ width- Sets
inline frame.
3. Name= used to
inline frame.
Inline frame
Text1.html
bars
1. Client side image maps- they are executed on client machine, this processing is done in the
browser which increases the speed. And they are not dependant on server. To mention that
image map in an image, use USEMAP attribute of the <img>.
a. <Map> tag- used to define hotspot in an image. It has name attribute.
b. <Area> tag-used to define the shape on map. Attributes arei. Shape- specifies as rectangle, circle and polygon.
ii. Cords- specifies coordinates for rectangle, circle and polygon.
iii. Href- specifies path of html file or URL of website.
iv. Alt- specifies alternative text given to hotspot.
Program (Practical No. 3)
<html>
<head>
<title>client-side image mapping</title>
</head>
<body>
<img src="Sunset.jpg" usemap="#mymap" border="3"></img>
<map name="mymap">
<area shape="circle" coords="577,133,110 " href="http://www.yahoo.com"
alt="yahoo"></area>
<area shape="rectangle" coords="64,52,256,153" href="http://www.google.com"
alt="google"></area>
<area shape="polygon" coords="248,262,248,347,334,395,421,348,422,270,314,216"
href="http://www.rediff.com" alt="rediff"></area>
</map>
</body></html>
2. Server side image maps- in server side image mapping browser with server interprets data.
ISMAP is used in server side image mapping with <img> tag.
Create an external text file with the extension (.map) place this file in the folder which contains
image.
<html><body>
<a href=text.map>
<img src=Sunset.jpg ISMAP></img>
</a></body><html>
Text.map
circle 577,133,110 http://www.yahoo.com
rectangle 64,52,256,153 http://www.google.com
polygon 248,262,248,347,334,395,421,348,422,270,314,216 http://www.rediff.com
Combining client and server side image mapsIt contains elements of both client and server side image maps.
<html><body>
<a href=text.map>
<img src=Sunset.jpg ISMAP></img></a>
<map name="mymap">
<area shape="circle" coords="577,133,110 " href=http://www.yahoo.com>
<area shape="rectangle" coords="64,52,256,153" href=http://www.google.com>
<area shape="polygon" coords="248,262,248,347,334,395,421,348
href="http://www.rediff.com" >
</map></body><html>
Text.map
Circle 577,133,110 http://www.yahoo.com
Rectangle 64, 52,256,153 http://www.google.com
Polygon 248,262,248,347,334,395,421,348,422,270,314,216 http://www.rediff.com
Forms
Forms are used to accept the data from user and send it for processing.
<Form> ..</form>tag is used to insert form on the web page.
Attributes-
1. Method-is used to send the data to the server for processing. It has two values GET or POST.
The GET is the default method.
2. Action-this attribute is used to specify the URL of the server where form information is to be
submitted.
3. Name- this attribute is used to assign the name to form.
The <input> tag
The <input> tag allows users to input data to your web server.
Attributes of <input>tag1.
2.
3.
4.
5.
6.
Type- it defines the type of input field such as text, password, checkbox, radio button,
submit, reset etc.
Name- Specifies the name of an <input> element.
Value-Specifies the value of an <input> element.
Size- it defines the maximum characters that can be entered in to text type.
Src-Specifies the URL of an image.
Maxlength- it defines the maximum characters that can be entered in to text or password
type input field.
*****
submit
reset
7. Hidden- It indicates a form field that does not appear visibly in the document.
submit
<title>Feedback Form</title></head>
<body bgcolor="green">
<h1>Feedback Form</h1>
<form name="Registration form" method="Post" action=" ">
Name:<input type="text" Name="First name" maxlength="30" size="15"><br>
Address:<textarea name="Add" Rows="4" cols="15"></textarea> <br>
State:<select name="state" size="0">
<option value="0"> Maharashtra
<option value="1"> Delhi
<option value="2"> Goa
<option value="3"> Gujrat
</select><br>
Gender:<Input type="Radio" name="Gender" value="Male"> Male
<Input type="Radio" name="Gender" value="Female" checked> Female<br>
Your interest:<Input type="Checkbox" name="Interest" value="German"> German
<Input type="Checkbox" name="Interest" value="French"> French
<Input type="Checkbox" name="Interest" value="I.T."checked> I.T.<br>
Submit:<input type="submit" value="submit">
Reset:<input type="reset" value="reset"></form>
</body></html>
Inserting Sound and VideoAudio-An audio file format is a file format for storing digital audio data on a computer system
User can insert sound or video file on mouse click or as background.
File formats for sound files1).wav (wave)-It is standard sound format developed by Microsoft.
<html><head>
<title>AUDIO WITH CONTROL</title></head>
<body>
<embed src="chord.wav" loop="true" width="100" height="100" autoplay="true"><br>
<img src="J0300520.gif" width="100" height="100">
</img></embed>
</body></html>
AUDIO WITHOUT CONTROL
<html><head>
<title>AUDIO WITHOUT CONTROL</title></head>
<body>
<bgsound src="chord.wav" loop="true" width="100" height="100" autoplay="true"><br>
<img src="J0300520.gif" width="100" height="100">
</img></bgsound>
</body></html>
Adding video to web pages using <dynsrc> tag1) DYNSRC (Dynamic Source) attribute helps to add video file on webpage without control.
<img> tag is used to add image on the web page.
e. g. <img dynsrc="clock.avi">
2) Start=FILEOPEN, which is the default value, makes the movie start when the file is opened
or start=MOUSEOVER starts the movie start when you put your mouse over it
2) Loop=LOOP states how many times the movie should repeat itself.
<head>
</head>
<body>
<h4><marquee loop="2" direction="right">input devices</h4></marquee></br>
<table border="2" bordercolordark="red" bordercolorlight="green">
<tr>
<th>name</th>
<th>price</th>
<tr>
<td>keyboard</td>
<td>250</td>
<tr>
</tr>
</tr>
<td>mouse</td>
<td>400</td>
</tr>
</table>
<blink>buy</blink>
<img src="abc.jpg" alt="broken image" height=100 width=75></img>
</body>
</html>
</body>
An inline style affects only the element for which the style is defined. i.e. <p> tag
2. Internal Style Sheet-internal style sheet should be used only when single document has
unique style. To define CSS into html code <style> tag is used within <head> tag.
<html>
<head>
<title> CSS</title>
<style>
Body{background:yellow}
P{colr:blue;align:center}
</style></head>
<body>
<p>Ness Wadia College </p>
</body></html>
3. External Style Sheet-external style sheet is mainly used when the style is applied to many
pages. In this type styles are stored in a separate file with a .css extension. Link the file
with the html document using <link> tag.
<Link> tag- is used to link style sheet to an html document.
Attributes of <link> tag1. REL- this attribute is used to define relationship between the linked file and the html
document.
2. TYPE- this attribute is used to specify a media type= text/css for a CSS
3. HREF- specifies the css file name to be linked.
Steps1. First create file text.css external file that stores style definitions.
2. The second file, style.html, is html document that uses the style definitions stored in the
file text.css.
Text.css
H1 {color: blue; align: center; background: yellow}
P {font-family: Ariel; font-size: 7pt; color: pink} (save this file with text.css)
Style.html
<html><head>
<title>external css </title>
<link rel=stylesheet type=text/css href=text.css></head>
<body>
<h1> Welcome</h1>
<p>Ness Wadia College </p>
</body></html>
Classes and IDsClasses- are a very effective method of applying styles to the web documents. With the class
selector you can define different styles for the same type of HTML tag or element. A class
always starts with a (.) Dot which is followed by class name.
<html>
<head><title>Classes</title>
<Style>
.ABC {color: lime; background: aqua; font-family: comic sans ms}
</style> </head>
<body>
<p class=ABC>Ness Wadia College</p>
<h1 class=ABC>Welcome </h1>
</body>
In the Above example, .ABC is a class name. <h1> and <p> share the same styles defined in the
class .ABC.
The id attributeThe id attribute is used to specify a unique style for the element. The functionality of both class
and ID attributes is same.
The id attribute uses the HTML element, and is defined as#" followed by name.
E.g. #S12 {font-size: 18pt}
<p ID=S12> Welcome to web designing</p>
Each ID must have a unique value. The value must be an initial letter followed by letters/digits.
1) Absolute-An absolute positioning defines the exact pixel value where the specified HTML
element will appear. Values are left, right, top, and bottom.
Example
<Style>
h2 {position: absolute; left: 100px; top: 150px ;}
</style>
2) Relative Positioning-it is the distance from previous element of the web page. A relative
positioned element is positioned relative to its normal position.
Example
<style>
h2 {position: relative; left:-20px}
</style>
3D LayersThe layer is created by assigning the position attribute to the style. The position can be either
absolute or relative. Z-index is a property that is used to specify layer. Z-index has numeric value
start from 1. Z-index=1 means an object is placed first on the web page.
e.g. <img src=sunset.jpg height=100 width=100 style=position: absolute; top: 50px; left:
64px></img>
<img src=Blue hills.jpg height=100 width=100 style=position: absolute; top: 50px; left:
60px></img>
In the above example first image is covered by the second image. But now user can change this
effect using z-index property.
<img src=sunset.jpg height=100 width=100 style=position: absolute; top: 50px; left: 64px; zindex=2></img>
<img src=Blue hills.jpg height=100 width=100style=position: absolute; top: 50px; left: 60px;
z-index=1></img>
Above example shows overlapping of second image on first image.
Letter SpacingThe letter spacing property defines an amount of space between characters. The value must be in
the length format.
30pt; Letter-spacing:
Welcome</div>
</body></html>
Text-alignThe text align property aligns the text in an element. The possible values are-left, right, centre
and justify.
<div style=font-size: 30pt; text-align: center>Welcome</div>
Text-DecorationThe text decoration property sets effect to the text such as blink, line-through, over line,
underline or no line.
e.g. <div style=font-size: 30pt; text-decoration: underline>Text decoration</div>
Web ServerAfter creation of web pages, it needs to be transferred to server; we can access these web pages
through the internet.
To avoid cost and space related some problems we can create our own web server.
Various web servers are IIS (Internet Information Server), PWS (Personal Web Server), UNIX,
apache etc.