WT Unit1 - New Murali

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 23

SRI HARSHINI DEGREE COLLEGE.

ONGOLE

SRI HARSHINI DEGREE COLLEGE, ONGOLE


SEM-VI
WEB TECHNOLOGIES

WEB TECHNOLOGIES-SYLLABAS
UNIT – I
1|Page N.MURALI KRISHNA
SRI HARSHINI DEGREE COLLEGE.ONGOLE

HTML: Basic HTML, Document body, Text, Hyper links, adding more formatting,
Lists, Tables using images. More HTML: Multimedia objects, Frames, Forms
towards interactive, HTML document heading detail
UNIT – II
Cascading Style Sheets: Introduction, using Styles, simple examples, your own
styles, properties and values in styles, style sheet, formatting blocks of
information, layers.
UNIT – III
Introduction to JavaScript: What is DHTML, JavaScript, basics, variables, string
manipulations, mathematical functions, statements, operators, arrays,
functions. Objects in JavaScript: Data and objects in JavaScript, regular
expressions, exception handling
UNIT – IV
DHTML with JavaScript: Data validation, opening a new window, messages and
confirmations, the status bar, different frames, rollover buttons, moving
images,
UNIT – V
XML: defining data for web applications, basic XML, document type definition,
presenting XML, document object model. Web Services

References:
1. Harvey M. Deitel and Paul J. Deitel, “Internet & World Wide Web How to
Program”, 4/e, Pearson Education.
2. Uttam Kumar Roy, Web Technologies from Oxford University Press

UNIT-i: HTML

2|Page N.MURALI KRISHNA


SRI HARSHINI DEGREE COLLEGE.ONGOLE

1. What is HTML? Explain the structure and features of HTML?

HTML is Hypertext Markup Language massively used in developing web


pages. HTML was developed by “Tim berners lee” in 1989, Here the word
“markup “means to highlight the given text. In HTML highlights different views
of a given web page in terms of headers, titles, plain text, images, sounds etc.
It does these things by using built-in tags, where, a tag is nothing but a special
keyword supported by HTML, inscribed under delimiters
“<” Tag “>”.
Features of HTML:
Html is a markup language; mark-up is the code that contains set of tags
that defines the text to be formatted.
 The browser parses through these tags and displays the text, images etc.
 Html documents are small in size and easy to send across the net.
 It supports text, images, multimedia etc
 It is interactive with CSS, JavaScript, and applets.
 Html allows the programs to embedded in it. And it is easily recognized
and interpreted by the popular web browser.
 Every HTML code should begin with <HTML> tag and end with </HTML>
tag.
 HTML is platform independent and not case sensitive language
 HTML is used to implement a static website and it is used to display the
information in a webpage with different styles.
 Every HTML code should be saved by .HTML or .HTM extension.
 There is no specific editor devised for writing HTML codes, rather than a
given HTML code can be written on a simple notepad.
 The output of a given HTML document can be visualized by typing the
path (where a given HTML document has been saved) along with .HTML
extension on the address bar of any web browser (internet explorer,
firefox).
 If the browser is not displaying your expected output, it means that the
HTML code is carrying certain errors which should be sufficiently
debugged.
Structure of HTML Program

3|Page N.MURALI KRISHNA


SRI HARSHINI DEGREE COLLEGE.ONGOLE

All HTML documents follow the same basic structure. They have a head
which contains control information used by the browser and server and a large
body. The body contains the content that displays on the screen and tags
which control how that content is formatted by the browser. The basic
document is:

<html>
<head>
<title> Title to displayed on Title Bar </title>
</head>
<body>
Content to be displayed on the web page.
</body>
</html>

The entire document is surrounded by <html> … </html> which tell the


software that it is now processing HTML. Most web browsers can display a
number of types of content. If the page were not enclosed in html tags the
page might be displayed as plain text with both content and formatting
information on display.

<html> … </html>
Starting an HTML page. It tells the browser that everything contained
between them is a HTML code for creating web pages. The <html> and </html>
tags should always be the first and last lines of code in the HTML file.

<head> … </head>
This tag contains the head of an HTML document, which holds information
about the document, such as its title. There are certain tags, like
<link>,<title>,<style > and <script> which can only appear in the page’s head.

<title> … </title>
It contains the title of HTML document which will appear in the web
browser’s title bar and is used by search engines to refer the document.

4|Page N.MURALI KRISHNA


SRI HARSHINI DEGREE COLLEGE.ONGOLE

<body> … </body>
This tag contains the body of the HTML document, which includes the
contents that will actually appear in the web browser. It may include text,
images, links, forms etc.

3. Write the attributes Body tag attributes:

HTML tags tell web browsers how to format and organize our web pages.
An attribute is a keyword that we use in an opening tag to give more
information to the web browser.
(a) Background: It is used to have an image file as a background of a
browser.
(b) Bgcolor: It specifies the color of the browser’s background. It may be
one of the predefined colors or a color value.
(c) Text: Color of the text in the document.

2. What is formatting? Explain the tags used to format text in HTML?


Formatting is the process of changing the appearance of data /text on
the web page.

Formatting tags are:


<
>
The <font> tag is used to change the format of the text on the web page.
The most important attributes are as follows:
 face: The type of font. Common ones include "Time New Roman",
"Verdana", and "Helvetica."
 size: This indicates the size of the text. This can be absolute (0 .. 6), or
relative ("+1", "+2", ... or "-1", "-2" ...)
 color: This indicates the color of the text. Either the color name or the
six-character color code may be used to specify color.

Example:

5|Page N.MURALI KRISHNA


SRI HARSHINI DEGREE COLLEGE.ONGOLE

1. <font size=2 face="Helvetica" color=red>This illustrates the attributes of the


font tag.</font>
2. <font size="+1" face="Verdana" color=AA5088>This illustrates the
attributes of the font tag.</font>

Bold tag: <b>: The <b> tag will bold the text inside the tag.

Italic tag: <i>: The <i> tag will italicize the text inside the tag.

Underline tag: <u>: The <u> tag will underline the text inside the tag.

Example:
This <b>example</b> shows how <i>important</i> it is to use
<u>tags</u>.

Header Tags
The header tags <h1>, ... <h6> allows us to place additional importance
on the text within such tags. <h1> has the largest size, and <h6> the smallest.
Many search engines put additional weight on the texts within the header tags.

Example:
<h1>This is h1 text.</h1>
<h2>This is h2 text.</h2>
<h3>This is h3 text.</h3>
<h4>This is h4 text.</h4>
<h5>This is h5 text.</h5>
<h6>This is h6 text.</h6>

<center>: The <center> tag causes all the text within the tag to be centered.

Example:
<center>This is centered text.</center>

<br>: The <br> tag indicates a line break. This tag is most often used by itself,
without a corresponding closing tag.

6|Page N.MURALI KRISHNA


SRI HARSHINI DEGREE COLLEGE.ONGOLE

<p>: The <p> tag indicates a new paragraph. It is the same as <br><br>. This
tag is most often used by itself, without a corresponding closing tag.

<sup>: The <sup> tag makes the text to be superscripted.


<sub>: The <sub> tag makes the text to be subscripted.

Example:
A <sup> 2 </sup> : is outputted as A2
A <sub> 2 </sub> : is outputted as A2

Example:

<html>
<head>
<title>Text Formatting</title></head>
<body>
<p><b>This text is bold</b></p>
<p><strong>This text is strong</strong></p>
<p><big>This text is big</big></p>
<p><em>This text is emphasized</em></p>
<p><i>This text is italic</i></p>
<p><small>This text is small</small></p>
<p>This is<sub> subscript</sub>
<p> <sup>superscript</sup></p>
<p><u>underline</u>
<p> Hai this
Nalanda
Degree college</p>
<pre> Dono:1
House:1
IGMS COMPLEX </pre>
<font size=”15”>it set font size as 15</font>
<font color=”yellow”>text displayed in yellow color</font>
<basefont size=”15”>

7|Page N.MURALI KRISHNA


SRI HARSHINI DEGREE COLLEGE.ONGOLE

<h1>ndc</h1>
<b>Vijayawada</b>
</basefont>
</body>
</html>

3. Explain various types of lists in HTML?

One of the most effective ways of structuring a Website or its contents is


to use lists. Lists may be for something as simple as supplying a piece of
information or for providing a straightforward index to the site.

HTML provides three types of lists:


1. Unordered list (or) bulleted list,
2. Ordered list (or) numbered list,
3. Definition list.
Unordered list:

UN ordered list represented by <ul>…</ul>


The basic unordered list has a bullet in front of each item. Everything between
the tags must be encapsulated within <li>…</li> tags. Different types of bullet
symbols can be specified by using the “type” attribute.

Attribute Value Symbo Description


l
Disc  Black filled circle
Square  Black filled Square
Circle o Empty circle

Syntax:<ul [ type = “disc” | “square” | “circle” ] > … </ul>

Ex: <ul>
<li>MURALI KRISHNA</li>
<li>SRI HARSHINI DEGREE COLLEGE</li>
8|Page N.MURALI KRISHNA
SRI HARSHINI DEGREE COLLEGE.ONGOLE

</ul>

Ordered list:

Ordered list represented by <ol>…</ol>


An ordered list has a number instead of a bullet in front of each list item.
Different numbering schemes can be specified depending upon preference. A
list can number from any value. The starting value is given by the “start”
attribute. As with the unordered list all items in an ordered list must be
enclosed within <li>…</li>

Syntax: <ol [ type=”1” | “a” | “A” | “I” | “i” ] [ start = “n” ] > … </ol>
Ex:
<ol>
<li>SHDC</li>
<li>ONGOLE</li>
</ol>

Note: <li>…</li>
The ordered or unordered lists are each made up of sets of list items.
Elements of a list may be formatted with any of the usual text formatting tags
and may be images or hyperlinks.

Definition list.:
<dl>…</dl>
Definition lists are different to the previous types in that they do not use
list items to contain their members. Elements within a definition list are either
items being defined or their definitions.

<dt>…</dt>
Definition terms mark items whose definition will be provided by the
next data definition. They can be formatted using any regular text formatting.
The closing tag is optional as it is assumed once a <dd> tag is reached.

<dd>…</dd>

9|Page N.MURALI KRISHNA


SRI HARSHINI DEGREE COLLEGE.ONGOLE

Definitions of terms are enclosed within these tags. The definition can
include any text or block formatting elements. The text of a definition is usually
rendered indented and on the line below the preceding item.
Ex: <dl>
<dt>SHDC</dt>
<dd>DEGREE AND PG</dd>
</dl>
Example for list:
<html>
<body>
<H1>UN ordered list</H1>
<ul type="disc">
<li>C-LANGUAGE</li>
<li>JAVA</li>
<li>.NET</li>
</ul>

<h4>ordered list :</h4>


<ol>
<li>Dennis Ritchie</li>
<li>JAMES GOSLINGS </li>
<li>MICROSOFT</li>
< </ol>

Definition List

<dl>
<dt>SHDC</dt>
<dd>SHDC have good management </dd>
</dl>
</body>
</html>

4. Explain the attributes of a table tag in HTML with an example?

10 | P a g e N.MURALI KRISHNA
SRI HARSHINI DEGREE COLLEGE.ONGOLE

The table is one of the most useful HTML constructs. Tables have two
uses: structuring pieces of information and structuring the whole Web page.

<table>
The <table> tag specifies the presence of a table. This is very often used
in conjunction with the <tr> and the <td> tags.
The following attributes are commonly used to define the properties of
this table:

 width: This specifies the width of the table. Can be specified in pixels or
in relative terms (for example, 100%).
 border: This specifies whether the table will have a border. The number
indicates the thickness of the border.
 cellspacing: The amount spacing between the cell wall and the cell
border. The area enclosed by the cell walls are the maximum amount of
area that text can be displayed in a cell.
 cellpadding: The amount padding between cells and the each cell wall in
a table.
 bgcolor: This specifies the background color for this table. The color
value may be specified as the color name or the six-character color code.

<tr>
The <tr> tag specifies the presence of a row. The following attributes are
commonly used to define the properties of this row:

 bgcolor: This specifies the background color for this row. The color value
may be specified as the color name or the six-character color code.
 height: This specifies the height of the row.
 rowspan: This specifies the number of rows this particular row occupies.

<td>
The <td> tag specifies the presence of a column. Columns are specified
within each row. The following attributes are commonly used to define the
properties of the column:

11 | P a g e N.MURALI KRISHNA
SRI HARSHINI DEGREE COLLEGE.ONGOLE

 valign: It makes the text to be aligned vertically either at top, center,


bottom.
 width: This specifies the width of the column. Can be specified in pixels
or in relative terms (for example, 50%).
 bgcolor: This specifies the background color for this column. The color
value may be specified as the color name or the six-character color code.
 colspan: This specifies the number of columns this particular column
occupies.

Example for table:

<html>
<body>
<table border=2 cellspacing=10 cellpadding=10 height 100 width="500" >
<tr>
<th>sname</th>
<th>sno</th>
<th>scollege</th>
</tr>

<tr bgcolor=”red”>
<td>MURALI</td>
<td>111</td>
<td>SHDC</td>
</tr>

<tr bgcolor=”blue”>
<td>BABU</td>
<td>333</td>
<td>SHDC</td>

</tr>
</table>
</body></html>

12 | P a g e N.MURALI KRISHNA
SRI HARSHINI DEGREE COLLEGE.ONGOLE

5. Explain Hyperlinks in html or link in html?

A hyperlink (or link) is a word, group of words, or image that you can
click on to jump to a new document or a new section within the current
document. When you move the cursor over a link in a Web page, the arrow
will turn into a little hand. Links are specified in HTML using the <a> tag.

The <a> tag can be used in two ways:


 To create a link to another document, by using the href attribute
 To create a bookmark inside a document, by using the name attribute

Syntax:
<a href="url">Link text</a> , where, href attribute specifies the destination of a
link.

Example:
<a href="http://www.GOOGLE.com/">Visit GOOGLE </a>

Note: The "Link text" need not have to be text. You can link from an image or
any other HTML element.

target Attribute
The target attribute specifies where to open the linked document. The
example below will open the linked document in a new browser window:

Example:
<a href="http:// www.ravithetutor.com" target="_blank"> Visit Ravi The Tutor
</a>

name Attribute
The name attribute specifies the name of an anchor. The name attribute
is used to create a bookmark inside an HTML document. Bookmarks are not
displayed in any special way. They are invisible to the reader.

13 | P a g e N.MURALI KRISHNA
SRI HARSHINI DEGREE COLLEGE.ONGOLE

Syntax:
A named anchor inside an HTML document:
<a name="tips">Useful Tips Section</a>
Create a link to the "Useful Tips Section" inside the same document:
<a href="#tips">Visit the Useful Tips Section</a>

Example:

<html>
<head>
<title>hyperlinks</title></head>
<body bgcolor=”yellow” text=”blue”>
//link to another document
<a href=”url”>hypertext</a>
//provide link in inside an HTML document
<a name="tips">Useful Tips Section</a>
// Create a link to the "Useful Tips Section" inside the same document:
<a href="#tips">Visit the Useful Tips Section</a>
</body>
</html>

6. Explain HTML Frames?


The main objective of frame is 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.

Frameset Element
The frameset element holds two or more frame elements. Each frame
element holds a separate document. The frameset element states only HOW
MANY columns or rows there will be in the frameset.
Syn: <frameset cols="25%,75%">…….</frameset>

Frame Element:
The <frame> tag defines one particular window (frame) within a
frameset.

14 | P a g e N.MURALI KRISHNA
SRI HARSHINI DEGREE COLLEGE.ONGOLE

Syn: <frame src="frame_a.htm" name=”string” />

Example:
<html>
<head>
<title>frames rxample</title>

<frameset cols="25%,75%">
<frame src="frame_a.htm" />
<frame src="frame_b.htm" />
</frameset>
</html>

In the above example the first column is set to 25% of the width of the
browser window. The second column is set to 75% of the width of the browser
window. The document "frame_a.htm" is put into the first column, and the
document "frame_b.htm" is put into the second column

// Note: The frameset column size can also be set in pixels (cols="200,500"),
and one of the columns can be set to use the remaining space, with an asterisk
(cols="25%,*").

Nested frames:
Nested frames are process of subdividing already existing frames
i.e. for example if the webpage is divided into either row wise or column wise
frames first, and then again the row wise frames are subdivided into column
wise or column wise frames into row wise frames is called nested frames.
Example:
<html>
<head>
<title>frames example</title>

<frameset cols="25%,75%">
<frameset rows=”50,50”>
<frame src="frame_a.htm" />
<frame src="frame_b.htm" />
15 | P a g e N.MURALI KRISHNA
SRI HARSHINI DEGREE COLLEGE.ONGOLE

</frameset>
<frame src="frame_a.htm" />
</frameset>
</html>

The disadvantages of using frames are:


 The web developer must keep track of more HTML documents
 It is difficult to print the entire page

7. Explain complex HTML forms and its controls.

HTML provides several mechanisms to collect information from people


who are viewing the website. “Form” is one of such mechanisms. Using forms
we will be able to handle HTML controls like buttons, checkboxes, radio
buttons, select controls, text areas and more. To use HTML controls we must
enclose them in HTML forms.

Available Controls:
Controls are created using <INPUT> tag & TYPE attribute.
1. Form:
<form> … </form> creates an HTML form, used to enclose HTML
controls. The attributes are:
a) Action: Gives the URL which will handle the form data.
b) Method: Indicates a method or protocol for sending data to the
target URL. The Get method is the default.
2. Button:
<input type=”button”> creates an HTML button in a form. The attributes
are:
a) Value: set the caption of the element.

3. Text Fields:
<input type=”text”> creates a text field that the user can enter or edit
text inside it. The attributes are:
a) size: Sets the size of the control.
b) value: The value entered in the text field.

16 | P a g e N.MURALI KRISHNA
SRI HARSHINI DEGREE COLLEGE.ONGOLE

c) maxlength: sets the maximum number of characters enter in the text


field.

4. Password:
<input type=”password”> creates a password text field, which shows
asterisks on the text field. The attributes are:
a) maxlength: sets the maximum length f the data in the control.
b) Name: gives the name of the control.
c) Value: represents the value entered in the textfield.

5. Checkbox:
<input type=”checkbox”> creates a checkbox in a form. The attributes
are:

a) Checked: Indicates if the checkbox should appear checked initially or


not.
b) Size: sets the size of the checkbox.
c) Value: represents the result of the checkbox when clicked, which is
passed to the forms action URL.
6. Radio buttons:
<input type=”radio”> creates a radio button in the form. The attributes
are:
a) Checked: Indicates if the checkbox should appear checked initially or
not.
b) Value: represents the result of the checkbox when clicked, which is
passed to the forms action URL.

7. Selection lists:
<select> … </select> Creates a drop-down lists, where the user can
select choice from the list of elements. And <option>…..</option> tag is used
to provide values . The attributes are:
a) name: represents the name of the control.
b) value: the value of selected item.

17 | P a g e N.MURALI KRISHNA
SRI HARSHINI DEGREE COLLEGE.ONGOLE

8. Textarea:
<textarea> … </textarea> creates a textarea, much like a two
dimensional text field. The attributes are:
a) Rows: specifies the number of rows visible in the control.
b) Cols: Specifies the number of columns visible in the control.

9. Submit button:
<input type=”submit”> creates a submit button that the user can click to
send data in the form back to web server. The attributes are:
a) Name: sets the name of the control.
b) Value: Text to be displayed on the button.

10. Reset button:


<input type=”reset”> creates a reset button in a form that resets all
fields to their original values. The attributes are:
a) Name: sets the name of the control.
b) Value: Text to be displayed on the button.

Example for forms:


<Html>
<Body>
<Form>
<p>enter u r name :< /p>
<input type=”textbox” name=”sname” size=15><br>
<p>enter u r password :</p>
<input type=”password” name=”pwd” size=10><br>
<p>enter u r sex :</p>
<input type="radio " name="sex" value="male" /> Male<br />
<input type="radio" name="sex" value="female" /> Female<br />
<p>enter u r college:</p>
<input type=”checkbox” name=”college” value=”SHDC”>SHDC<br>
<input type=”checkbox” name=”college” value=”SNDC”>SNDC <br>
<input type=”checkbox” name=”college” value=”BAKR”>BAKR <br>
<b> cooments:</b>

18 | P a g e N.MURALI KRISHNA
SRI HARSHINI DEGREE COLLEGE.ONGOLE

<textarea rows=”5” cols=”5”>


</textarea>
<input type="submit" value="Submit" >
<input type=”reset” value=”reset”>
</form>
</body>
</html>

8. What is the importance of Multimedia in Web applications? (Or) explain how


the audio or video files are inserted into webpage.

 Multimedia means processing of multiple applications and it is used to


include multimedia objects in to web page.
 Multimedia objects are audio or video files i.e. these objects are
embedded into web page.
 One of the biggest attractions of the Web must be the amount of
multimedia data that can be presented from within simple text
documents.
 Multimedia is an all-encompassing term which can mean radically
different things to different people.
 On the Web it is generally used to mean sound and image data, although
it is probably best used to define any data which is not plain text or
simple images.
 To include external objects in a Web page, there are several choices,
such as, an image can be placed either as background of the web page
using <body> tag or can be placed in document using <img> tag or can
also be used as hyperlinks.
 This may involve running an application outside the browser as happens
with players for streamed data in Real Audio and Real Video formats.
 A power point presentation application may open inside the browser.

Including multimedia Objects:


1. An <embedded> tag is used to insert an audio or video file into
webpage

19 | P a g e N.MURALI KRISHNA
SRI HARSHINI DEGREE COLLEGE.ONGOLE

Syntax:
<embed src=”url” height=”100” width=”100” autostart=”true/false”>
Example:
<html>
<head><title>including multimedia objects</title>
</head><body>
<embed src=”url” height=”100” width=”100” autostart=”true”>
</body></html>
Attributes of embedded tag is:
Height, width is two attributes defines the size of audio or video file in
web page.
Auto start defines that the multimedia objects automatically play or not when
we execute a program.

2. An <object> tag in HTML is used to embed multimedia objects directly


into the page.
<object classid=”URL” data=”URL” [codebase=”URL”]
type=”string” height=”n” width=”n”> . . . </object>
Here classid defines the address of audio or video files, and height and width
defines space occupied in webpage.
Example:
<Html>
<Head><title>including multimedia objects</title>
</head><body>
<object classid=”URL” data=”URL” type=”string” height=”n”
width=”n”>
</object>
</body></html>
3. Loading An Applet (or) explain about java applet?
A Java applet can be loaded in the webpage either by using an <applet>
tag or by an <object> tag.
<applet code=”classfile” [name = “string” ] width=”n” height=”n”
[codebase=”URL”] >
Where class file means java file to run in webpage. The codebase
parameter specifies the location of the applet,Name parameters distinguish

20 | P a g e N.MURALI KRISHNA
SRI HARSHINI DEGREE COLLEGE.ONGOLE

each applet in the web page. The space should allocate for applet is denoted
by the height and width parameters.
Example:
<head>
<title>including multimedia objects</title>
</head>
<body>
<applet code=”classfile” [name = “string” ] width=”n” height=”n”>
</body></html>

11. Explain in detail about the HEAD in HTML document.

The head is a very important part of any HTML page as it contains lots of
control information that is needed by browsers and servers.

Document Type Declarations: The document type declaration for basic HTML
is:
<! doctype html public “-//w3c//dtd html 4.0//en”
“http://www.w3c.org/TR/PR-html4.0/loose.dtd”>
Control Information:
The head of the document contains control information to be used by
servers and browsers. It contains the title of the document which will be
displayed at the top of the browser and, optionally, a list of keywords, a
description of the document, any files to be linked into the document, and
information about how the document was prepared.

<title>…</title>
The title is used to display the text to be displayed in the title bar. It is
also used as the name in bookmark files and on search engines.

<link rel=”type” href=”URI” type=”string” media=”string”>


The link tag is used to allow other documents to be linked to, or included
in, the current document. This tag is not commonly used but it is important
and useful when using style sheets.

21 | P a g e N.MURALI KRISHNA
SRI HARSHINI DEGREE COLLEGE.ONGOLE

<style> ,<script> tag also written head of html document.

9. Explain about Images in html?

Images are very commonly used in WebPages,


Browsers display a limited range of image types ie GIF,JPEG images will be
displayed by all browsers.
<img> tag is used include graphics in html document ,it is used for inserting an
image into html document.
Syntax:
<img src=”url” height=”n” width=”n” alt=”string” align=”top/center/bottom”>
Attributes of image tag:
Width, height, are the attributes of image element it defines the size of
image in web page
Align: this attribute defines the alignment of image displayed in webpage i.e.
either top/bottom/center of webpage .
Alt means alternative i.e. the alternative string displayed in web page when
the given URL is wrong.
Image can be included in webpage in 3 ways:
1. To set background image for webpage:
Syntax:
<body background=”url”>
2. syntax for to insert an image:
<img src=”url” height=”n” width=”n” alt=”string” align=”top/center/bottom”>
3. Syntax for hyper link an image:
<a href=”url”>hypertext</a>
Example:
<html>

22 | P a g e N.MURALI KRISHNA
SRI HARSHINI DEGREE COLLEGE.ONGOLE

<head>
<title>image program</title>
</head>
<body background=”url”>
<h1>the bellow syntax is for to insert an image</h1>
<img src=”url” height=”n” width=”n” alt=”string”
align=”top/center/bottom”>
<h2> the bellow syntax for hyper link an image</h2>
<a href=”url”>hypertext</a>
</body>
</html>

23 | P a g e N.MURALI KRISHNA

You might also like