0 - JSP - Web-Lab Manual
0 - JSP - Web-Lab Manual
WEB ENGINEERING
STD_NAME:
STD ID :
PROGRAM: BS(CS)
Section: A
Name of Student:
Signature: _______________________________________
Table of Contents
Code
<html>
<head><title>My Page</title></head>
<body>
<script language="JavaScript">
document.write(“Hello World!”);
</script>
</body>
</html>
Output
LAB-2
Objective
The objective of this program is to print Hello World with HTML tag on Web page
Code
<html>
<head><title>My Page</title></head>
<body>
<script language=“JavaScript">
document.write('<h1>Hello World!</h1>');
</script>
</body>
</html>
Output
LAB-3
Objective
The objective of this program is to learn Events (onMouseover, onClick) and alert command
Code
<html>
<head>
<title> My Page </title>
</head>
<body>
</body>
</html>
Output
LAB-4
Objective
The objective of this program is to learn prompt() method that displays a dialog box that prompts the
visitor for input.
Code
<html>
<head>
<title> My Page </title>
</head>
<body>
<script language="JavaScript">
prompt('Enter your name:','');
</script>
</body>
</html>
Output
LAB-5
Objective
Code
<HTML>
<TITLE> PROMPT() EXAMPLE </TITLE>
<HEAD>
<script language=javascript>
var sal = prompt("Enter Your salary")
if(sal<5000) {
alert("less"); }
else {
alert("greater"); }
</script>
</head>
</html>
Output
LAB-6
Objective
The objective of this program is to create a popup window using window.open() method
Code
<HTML>
<HEAD>
<TITLE> Pop-up Messages </TITLE>
</HEAD>
<BODY>
<SCRIPT LANGUAGE="JavaScript">
function instruct() {
window.open("instruct.html",“advert",
"status=no,toolbar=no,location=no,menu=no,width=400,height=300");
}
</SCRIPT>
<A HREF="#" onClick="instruct();"> instructions </A>.
</BODY>
</HTML>
Output
LAB-7
Objective
Code
<HTML>
<HEAD>
<TITLE> Instructions </TITLE>
</HEAD>
<BODY>
<H1> Instructions </H1>
These are the instructions. This is actually a separate HTML document, INSTRUCT.htm. Click the button
below to return.
<FORM NAME="form1">
<INPUT TYPE="button" VALUE="Close" onClick="window.close();">
</FORM>
</BODY>
</HTML>
Output
LAB-8
Objective
The objective of this program is to learn validation check on Text Boxes. This script will not allow user to
leave any text box blank.
Code
<HTML>
<HEAD>
<TITLE> Text Box Validation Check </TITLE>
</HEAD>
<BODY>
<script language="javascript">
function one() {
if(document.myform.t1.value=='') {
alert("Please fill the field first");
document.myform.t1.focus()
}
}
function two() {
if(document.myform.t2.value=='') {
alert("Please fill the field first");
document.myform.t2.focus()
}
}
</script>
<FORM name=myform>
<input type="text" name="t1"> <br>
<input type="text" name="t2" onfocus="one()"> <br>
<input type="submit" name="s1" value="submit" onfocus="two()">
</FORM>
</BODY
</HTML>
Output
LAB-9
Objective
The objective of this program is to learn validation check on Text Boxes. This script will not allow user to
take input in lowercase.
Code
<html>
<head>
<title> LOWERCASE VALIDATION CHECK </title>
</head>
<body>
<script language=javascript>
function check_it()
{
if (document.myform.uname.value != document.myform.uname.value.toUpperCase() ||
document.myform.fname.value != document.myform.fname.value.toUpperCase() )
{
alert("Please write again in Capital Letters");
document.myform.uname.value="";
document.myform.fname.value="";
document.myform.uname.focus();
}
Else
{
alert("Accepted Upper Case");
location="login.html";
}
}
</script>
</form>
</body>
</html>
Output
LAB-10
Objective
Code
<html>
<head>
<title> EMAIL VALIDATION CHECK </title>
</head>
<body>
<script language=javascript>
function emailcheck()
{
var string1=document.myform.email.value
if (string1.indexOf("@")==-1)
{
alert("Please input a valid email address!")
}
else
{
alert("Valid Email Address.");
}
}
</script>
<form name="myform">
</form>
</body>
</html>
Output
LAB-11
Objective
The objective of this program is to check maximum length of text entered in the Text Box.
Code
<html>
<head>
<title> Text Length </title>
</head>
<body>
<script language=javascript>
function validate()
{
x=document.myForm
input=x.myInput.value
if (input.length>5){
alert("The field cannot contain more than 5 characters!");
return false;
}
else
{
alert("Yes The Field Contain Less Than 5 Characters");
return true;
}
}
</script>
<form name="myForm">
</form>
</body>
</html>
Output
LAB-12
Objective
This Lab contains five programs and objective is to learn Form validation
Code-1
<html>
<head>
<title> getElementById demonstration </title>
</head>
<body>
<script language ="javascript">
function validate()
{
if(document.getElementById("t1").value=='')
{
document.getElementById("t1").style.backgroundColor='red';
}
}
</script>
<form>
Name : <input type = text value="" ID="t1">
<input type = button value = "SEND" onClick = "validate()">
</form>
</body>
</html>
Output
Code-2
<html>
<head>
<title> check email demonstration </title>
</head>
<body>
function checkemail()
{
var myemail=document.abc.email.value;
if(myemail== "")
{
document.getElementById("email_error").innerHTML="No Email Address entered";
return false;
}
else
{
document.getElementById("email_error").innerHTML="";
return true;
}
}
</script>
Output
Code-3
<html>
<head>
<title> check option button demonstration </title>
</head>
<body>
<script language ="javascript">
function checkoptions()
{
var payment="";
var len=document.abc.payment.length;
var i;
if(payment== "")
{
document.getElementById("radio_error").innerHTML="No Option Selected";
return false;
}
else
{
document.getElementById("radio_error").innerHTML="";
return true;
}
}
</script>
Output
LAB-13
Objective
Code
<html>
<head>
<title> image collections </title>
</head>
<body>
<table width=500>
<tr>
<td height=200 width=100> <img src="forward.gif" onClick="scroll_forward()"> </td>
<td width=300> <img src="pic_1.jpg" name = pic1> </td>
<td width=100> <img src="back.gif" onClick="scroll_backward()"> </td>
</tr>
</table>
p1.src="pic_1.jpg"
p2.src="pic_2.jpg"
p3.src="pic_3.jpg"
p4.src="pic_4.jpg"
p5.src="pic_5.jpg"
function scroll_backward()
{
if(counter==0)
{
alert("START OF PICTURES");
}
else
{
counter--;
}
document.pic1.src = imgArray[counter].src;
}
function scroll_forward()
{
if(counter == end)
{
alert("NO MORE PICTURES");
}
else
{
counter++;
}
document.pic1.src = imgArray[counter].src;
}
</script>
</body>
</html>
Output
LAB-14
Objective
Code
<html>
<head>
<title> image changes on mouseover </title>
</head>
<body>
function m_over()
{
document.getElementById("img1").src = "pic_2.jpg"
}
function m_out()
{
document.getElementById("img1").src = "pic_1.jpg";
}
</script>
</body>
</html>
Output
LAB-15
Objective
Code
<html>
<head>
<title> onchange demonstration </title>
</head>
<body>
<script language = javascript>
function myFunction()
{
var x=document.getElementById("fname");
x.value=x.value.toUpperCase();
}
</script>
Enter your name: <input type="text" id="fname" onchange="myFunction()">
</body>
</html>
Output
LAB-16
Objective
This lab contains 2 programs and the objective is to learn onkeyup() event.
Code-1
<html>
<head>
<title> onkeyup demonstration </title>
</head>
<body>
<script language = javascript>
function myFunction()
{
var x=document.getElementById("fname");
x.value=x.value.toUpperCase();
}
</script>
</body>
</html>
Output
Code-2
<html>
<head>
<title> onkeyup demonstration </title>
</head>
<body>
function writeMessage()
{
document.form1.mySecondInput.value=document.form1.myInput.value;
}
</script>
</form>
</body>
</html>
Output
LAB-17
Objective
<html>
<head>
<TITLE> WEB DINNER </TITLE>
for(i=0;i<n;i++)
{
if(document.diner.entries.options[i].selected)
{
orderString+=document.diner.entries.options[i].value+"\n"
}
}
document.diner.summary.value=orderString
}
</SCRIPT>
</HEAD>
<BODY>
<H2 ALIGN="CENTER">The Web Diner</H2>
<FORM NAME="diner">
<OPTION VALUE="Hamburger">Hamburger</OPTION>
<OPTION VALUE="Hot Dog">Hot Dog</OPTION>
<OPTION VALUE="Chicken Sandwich">Chicken Sandwich</OPTION>
<OPTION VALUE="French Fries">French Fries</OPTION>
<OPTION VALUE="Onion Rings">Onion Rings</OPTION>
<OPTION VALUE="Soda">Soda</OPTION>
<OPTION VALUE="Milk Shake">Milk Shake</OPTION>
<OPTION VALUE="Coffee">Coffee</OPTION></SELECT>
<P><B>You ordered: </B></P>
<P>
<TEXTAREA NAME="summary" ROWS="4" COLS="20"></TEXTAREA></P>
<P><INPUT TYPE="SUBMIT" NAME="order" VALUE="Let me have it!"></P>
</FORM>
</BODY>
</HTML>
Output
LAB-18
Objective
<HTML>
<HEAD>
<TITLE> WEB SURVEY PROGRAM </TITLE>
<SCRIPT language = javascript>
function showResults()
{
var resultMsg="“
if(document.survey.age[0].checked) resultMsg+="under 30, "
if(document.survey.age[1].checked) resultMsg+="between 30 and 60, "
if(document.survey.age[2].checked) resultMsg+="over 60, "
if(document.survey.sex[0].checked) resultMsg+="male, "
if(document.survey.sex[1].checked) resultMsg+="female, "
if(document.survey.reading.checked) resultMsg+="reading, "
if(document.survey.eating.checked) resultMsg+="eating, "
if(document.survey.sleeping.checked) resultMsg+="sleeping, "
document.survey.results.value=resultMsg
}
function upperCaseResults()
{
var newResults=document.survey.results.value
document.survey.results.value=newResults.toUpperCase()
}
</SCRIPT>
</HEAD>
<BODY>
<H2 ALIGN="CENTER">Survey Form</H2>
<FORM NAME="survey">
<P><B>Age:</B>
<INPUT TYPE="RADIO" NAME="age" VALUE="under30" ONCLICK="showResults()">Under 30
<INPUT TYPE="RADIO" NAME="age" VALUE="30to60" ONCLICK="showResults()">30 - 60
<INPUT TYPE="RADIO" NAME="age" VALUE="over60" ONCLICK="showResults()">Over 60</P>
<P><B>Sex: </B>
<INPUT TYPE="RADIO" NAME="sex" VALUE="male" ONCLICK="showResults()">Male
<INPUT TYPE="RADIO" NAME="sex" VALUE="female" ONCLICK="showResults()">Female</P>
<P><B>Interests: </B>
<INPUT TYPE="CHECKBOX" NAME="reading" ONCLICK="showResults()"> Reading
<INPUT TYPE="CHECKBOX" NAME="eating" ONCLICK="showResults()"> Eating
<INPUT TYPE="CHECKBOX" NAME="sleeping" ONCLICK="showResults()"> Sleeping</P>
<P>
<INPUT TYPE="BUTTON" NAME="makeUpper" VALUE="To Upper Case"
ONCLICK="upperCaseResults()"></P>
<P><B>Results: </B>
<INPUT TYPE="TEXT" NAME="results" SIZE="50"></P>
<INPUT TYPE="SUBMIT" NAME="submit" VALUE="Submit" ONCLICK='return confirm("Sure?")'>
<INPUT TYPE="RESET" NAME="reset" ONCLICK='return confirm("Sure?")'>
</FORM>
</BODY>
</HTML>
Output
LAB-19
Objective
The objective of this program is to scroll text on browser status bar
Code-1
<HTML>
<body>
<Script LANGUAGE="JavaScript">
var Count = 0;
var Text = "Mr. Asim enjoy with this scrolling status bar text!";
var Speed = 90;
var timerID = null;
var TimerRunning = false;
var i = 0;
while (i ++ < 140)
Text = " " + Text;
function Scroll(){
window.status = Text.substring(Count++, Text.length);
if (Count == Text.length)
Count = 0;
timerID = setTimeout("Scroll()", Speed);
TimerRunning = true;
}
function Start(){
Stop();
Scroll();
}
function Stop(){
if(TimerRunning)
clearTimeout(timerID);
TimerRunning = false;
}
Start();
</Script>
</Body>
</Html>
Output
PHP
LAB-20
Objective
The objective of this lab is to create database connection, creation of registration form and insertion of
record in database.
Code
DBCON.PHP
<?php
mysql_connect("localhost", "root", "") or die("Could not connect: " . mysql_error());
mysql_select_db("mydata");
?>
FORM.PHP
<input type=submit>
</form>
REG.PHP
<?php
include "dbcon.php";
if (@mysql_query($sql)) {
echo('<p><br><center><h1>Successfully added in the database<br><br> <a href=login.php>Login to
server</a></center></h1></p>');
} else {
echo('<p><br><center><h1>Error in registration: ' . mysql_error() . '</center></h1></p>');
}
mysql_close();
?>
Output
LAB-21
Objective
Code
LOGIN.PHP
<form action="usercheck.php" method="post">
</form>
USERCHECK.PHP
<?php
include "dblocal.php";
$query="SELECT * FROM users WHERE username= '$_POST[uname]' AND password= '$_POST[upass]' ";
$result = mysql_query($query) or die(mysql_error());
if($row = mysql_fetch_array($result)) {
?>
Output
LAB-22
Objective
The objective of this lab is to view all records of table on browser page
Code
<?php
include "dbcon.php";
?>
<th>Username</th>
<th>Name</th>
<th>Address</th>
</tr>
<?php
$query="Select * from users";
$result = mysql_query($query);
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
echo "<tr><td>$row[username]</td><td>$row[name]</td><td>$row[address]</td></tr>";
}
mysql_close();
?>
LAB-23
Objective
Code
edit.php
<html>
<head>
<title> Untitled Document </title>
</head>
<body>
<table border="1">
<?php
include "dblocal.php";
$order = "SELECT * FROM users";
$result = mysql_query($order);
while ($row=mysql_fetch_array($result))
{
echo ("<td> $row[Password] </td>");
echo ("<td> $row[Address] </td>");
echo ("<td> $row[Phone] </td>");
echo ("<td><a href=\"edit_form.php?us=$row[Username]\">Edit</a></td>");
echo ("<td><a href=\"del.php?us=$row[Username]\">Delete</a></td></tr>");
}
?>
</table>
</body>
</html>
edit_form.php
<html>
<head>
<title>Form Edit Data</title>
</head>
<?php
$us = $_GET["us"];
?>
<body>
<table>
<?php
include "dblocal.php";
$order = "SELECT * FROM users where Username ='$us'";
$result = mysql_query($order);
$row = mysql_fetch_array($result);
?>
<tr>
<td> Password </td>
<td> <input type="text" name="pass" size="20" value="<?php echo "$row[Password]"?>"> </td>
</tr>
<tr>
<td> Name </td>
<td> <input type="text" name="name" size="20" value="<?php echo "$row[Name]"?>"> </td>
</tr>
<tr>
<td> Address </td>
<td> <input type="text" name="address" size="40" value="<?php echo "$row[Address]"?>"> </td>
</tr>
<tr>
<td> Phone </td>
<td> <input type="text" name="phone" size="20" value="<?php echo "$row[Phone]"?>"> </td>
</tr>
<tr>
<td align="right"> <input type="submit" name="submit" value="Edit"> </td>
</tr>
</form>
</table>
</body>
</html>
edit_data
<?php
include "dblocal.php";
$pass=$_POST['pass'];
$name=$_POST['name'];
$address=$_POST['address'];
$phone=$_POST['phone'];
$user=$_POST['us'];
mysql_query($order);
header("location:edit.php");
?>
Output
LAB-24
Objective
Code
<?php
include "dblocal.php";
?>
<html>
<head>
</body>
</html>
LAB-25
Objective
Code
form1.php
<?php
include "dbcon.php";
?>
<form method="POST" action="form2.php">
Name: <input type="text" name="name"> <br>
Email: <input type="text" name="email_address">
<input type="submit" value="Go To Step 2">
</form>
form2.php
<?php
session_start();
$_SESSION['name'] = $_POST['name'];
$_SESSION['email_address'] = $_POST['email_address'];
?>
form3.php
<?php
//let's start the session
session_start();
formProcess.php
<?php
session_start();
include "dbcon1.php";
$sql = "INSERT INTO userform SET name='$_SESSION[name]', email='$_SESSION[email_address]',
membership_type='$_SESSION[membership_type]',
terms_and_condition='$_SESSION[terms_and_conditions]',
name_on_credit_card='$_POST[name_on_card]', credit_card_number='$_POST[credit_card_number]',
credit_card_expiration='$_POST[credit_card_expiration_date]'";
if (@mysql_query($sql))
{
echo('<p><br><center><h1>Successfully added in the database<br><br> </p>');
}
else
{
echo('<p><br><center><h1>Error Adding In DAtabase: ' . mysql_error() . '</center></h1></p>');
}
mysql_close();
?>
OUTPUT
LAB-26
Objective
Code
form1.php
<?php
include "dbcon.php";
?>
form2.php
<?php
session_start();
$_SESSION['name'] = $_POST['name'];
$_SESSION['email_address'] = $_POST['email_address'];
?>
<form method="post" action="form3.php">
free: <input type="radio" name="membership_type" value="Free">
Normal: <input type="radio" name="membership_type" value="Normal">
Delux: <input type="radio" name="membership_type" value="Deluxe">
Terms & Condition: <input type="checkbox" name="terms_and_conditions">
<input type="submit" value="Go To Step 3">
</form>
form3.php
<?php
//let's start the session
session_start();
form_process.php
<?php
?>
OUTPUT
LAB-27
Objective
Code
<html>
<head>
<title></title>
</head>
<body>
<form action="upload.php" method="post" enctype="multipart/form-data">
<table>
upload.php:
<?php
?>
OUTPUT
LAB-28
Objective
Code
<?php
if(isset($_REQUEST['email']))
{
$to = $_REQUEST['email'];
$subject=$_REQUEST['subject'];
$messege= $_REQUEST['messege'];
mail($to,$subject,$messege);
echo "THANKYOU FOR USING OUR MAIL FORM";
}
else
{
echo "<form action="mail.php" method="post">
EMAIL <input type="email" name="email">
SUBJECT <input type="text" name="subject">
Messege <textarea name="messege" col=20 rows=20> </textarea>
<input type="submit" name="button" /> <br />
</form>";
}
?>
CSS
LAB-29
Objective
Code
<html>
<head>
<style>
div
{
width:500px;
padding:50px;
box-shadow:inset 0px 0px 50px 25px blue;
margin:200px;
}
</style>
</head>
<body>
<div> STYLE SHEET</div>
</body>
</html>
OUTPUT:
LAB-30
Objective
Code
<html>
<head>
<style>
div
{
width:200px;
height:100px;
background-color:yellow;
-webkit-transform:rotate(180deg);
}
</style>
</head>
<body>
OUTPUT
LAB-31
OBJECTIVE:
CODE:
<html>
<head>
<style>
div
{
width:100px;
height:75px;
background-color:red;
border:2px solid black;
}
div#div2
{
-webkit-transform:translate(50px,100px);
}
</style>
</head>
<body>
LAB-32
OBJECTIVE:
CODE:
<html>
<head>
<style>
div
{
width:200px;
height:100px;
background-color:yellow;
border:1px solid black;
}
div#div2
{
margin:200px;
-webkit-transform:scale(2,4);
}
</style>
</head>
<body>
<div> Hello.This is a DIV element.</div>
<div id="div2"> Hellow.This is a Div element.</div>
</body>
</html>
OUTPUT:
LAB-33
OBJECTIVE:
CODE:
<html>
<head>
<style>
div
{
width:100px;
height:75px;
background-color:red;
border:1px solid black;
}
div#div2
{
margin:200px;
-webkit-transform:skew(30deg,20deg);
}
</style>
</head>
<body>
<div> Hello.This is a DIV element.</div>
<div id="div2"> Hellow.This is a Div element.</div>
</body>
</html>
OUTPUT:
LAB-34
OBJECTIVE:
CODE:
<html>
<head>
<style>
div
{
width:100px;
height:75px;
background:red;
-webkit-transition:width 2s;
}
div:hover
{
width:300px;
}
</style>
</head>
<body>
<div></div>
</body>
</html>
OUTPUT:
LAB-35
OBJECTIVE:
CODE:
<html>
<head>
<style>
div
{
text-shadow:-5px -5px 3px #06C,
5px 5px 3px #936;
color:#333;
margin:50px;
}
</style>
</head>
<body>
<div> STYLE SHEET</div>
</body>
</html>
OUTPUT:
LAB-36
OBJECTIVE:
CODE:
<html>
<head>
<style>
div
{
width:100px;
height:100px;
background:red;
-webkit-animation:myfirst 5s;
}
@-webkit-keyframes myfirst
{
from {background:red;}
to {background:green;}
}
</style>
</head>
<body>
<div></div>
</body>
</html>
OUTPUT
LAB-37
OBJECTIVE:
CODE:
<html>
<head>
<style>
div
{
width:100px;
height:100px;
background:red;
position:relative;
-webkit-animation-name:myfirst;
-webkit-animation-duration:5s;
-webkit-animation-timing-function:linear;
-webkit-animation-delay:2s;
-webkit-animation-iteration-count:infinite;
-webkit-animation-direction:alternate;
-webkit-animation-play-state:running;
}
@-webkit-keyframes myfirst
{
0% {background:red; left:0px; top:0px;}
25% {background:yellow; left:200px; top:0px;}
50% {background:blue; left:200px; top:200px;}
75% {background:green; left:0px; top:200px;}
100% {background:red; left:0px; top:0px;}
}
</style>
</head>
<body>
<div></div>
</body>
</html>
OUTPUT:
LAB-38
OBJECTIVE:
CODE:
<html>
<head>
<style>
div
{
width:220px;
padding:25px;
border:15px Solid green;
border-color:green blue pink black;
border-style:dashed dotted double groove;
margin:100px;
}
</style>
</head>
<body>
<div> HELLOW </div>
</body>
</html>
OUTPUT:
LAB-39
OBJECTIVE:
CODE:
<html>
<head>
<style>
.thumbnail
{
float:left;
width:110px;
height:90px;
margin:5px;
}
</style>
</head>
<body>
<h3>Image Gallery</h3>
<img class="thumbnail" src="1.jpg" width="107" height="90">
<img class="thumbnail" src="2.jpg" width="107" height="80">
<img class="thumbnail" src="3.jpg" width="116" height="90">
<img class="thumbnail" src="4.jpg" width="120" height="90">
<img class="thumbnail" src="5.jpg" width="107" height="90">
<img class="thumbnail" src="6.jpg" width="107" height="80">
<img class="thumbnail" src="7.jpg" width="116" height="90">
<img class="thumbnail" src="8.jpg" width="120" height="90">
</body>
</html>
OUTPUT
LAB-40
OBJECTIVE:
CODE:
<html>
<head>
<style>
ul
{
list-style-type:none;
margin:0;
padding:0;
}
</style>
</head>
<body>
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#news">News</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#about">About</a></li>
</ul>
</body>
</html>
OUTPUT:
LAB-41
OBJECTIVE:
CODE:
<html>
<head>
<style>
ul
{
list-style-type:none;
margin:0;
padding:0;
}
li
{
float:left;
}
a:link,a:visited
{
display:block;
width:120px;
font-weight:bold;
color:#FFFFFF;
background-color:#98bf21;
text-align:center;
padding:4px;
text-decoration:none;
text-transform:uppercase;
}
a:hover,a:active
{
background-color:#7A991A;
}
</style>
</head>
<body>
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#news">News</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#about">About</a></li>
</ul>
</body>
</html>
OUTPUT:
LAB-42
OBJECTIVE:
CODE:
<html>
<head>
<style>
div.img
{
margin:5px;
padding:5px;
border:10px solid #0000ff;
height:auto;
width:auto;
float:left;
text-align:center;
}
div.img img
{
display:inline;
margin:5px;
border:10px solid #ffffff;
}
div.desc
{
text-align:center;
font-weight:normal;
width:120px;
margin:5px;
}
</style>
</head>
<body>
<div class="img">
<a target="_blank" href="xyz.html"><img src="1.jpg" width="110" height="90"></a>
<div class="desc">PIC1</div>
</div>
<div class="img">
<a target="_blank" href="abc1.html"><img src="2.jpg" width="110" height="90"></a>
<div class="desc">PIC1</div>
</div>
<div class="img">
<a target="_blank" href="abc2.html"><img src="3.jpg" width="110" height="90"></a>
<div class="desc">PIC1</div>
</div>
<div class="img">
<a target="_blank" href="abc3.html"><img src="4.jpg" width="110" height="90"></a>
<div class="desc">PIC1</div>
</div>
</body>
</html>
OUTPUT:
LAB-43
OBJECTIVE:
CODE:
<html>
<head>
<link rel="stylesheet" type="text/css" href="gal.css">
</head>
<body>
<div class="accordian">
<ul>
<li>
<div class="image_title">
<a href="#">CANDY - 1</a>
</div>
<a href="#">
<img src="1.jpg" width=640px height=320px>
</a>
</li>
<li>
<div class="image_title">
<a href="#">CANDY - 2</a>
</div>
CSS CODE:
*{
margin: 0;
padding: 0;
}
body {
background: #ccc;
font-family: arial, verdana, tahoma;
}
.accordian {
width: 805px; height: 320px;
overflow: hidden;
.accordian ul {
width: 2000px;
/*This will give ample space to the last item to move
instead of falling down/flickering during hovers.*/
}
.accordian li {
position: relative;
display: block;
width: 160px;
float: left;
.accordian li img {
display: block;
}
}
.image_title a {
display: block;
color: #fff;
text-decoration: none;
padding: 20px;
font-size: 16px;
}
OUTPUT: