Multimedia & Animation Part-A Lab Manual
Multimedia & Animation Part-A Lab Manual
Part -A:
1) Write a HTML/5 program to demonstrate the use of Font family, font variant, font style, and font size.
7) Write a HTML/5 program to turn on/off a light bulb using JavaScript. Make use of .gif image and
buttons.
1) Write a HTML/5 program to demonstrate the use of Font family, font variant, font style, and font size.
<!DOCTYPE html>
<html>
<head>
<style>
// Font Family
p.p1 {
p.p2 {
p.p3 {
// Font Style
p.normal {
font-style: normal;
p.italic {
font-style: italic;
// Font Variant
p.normal {
font-variant: normal;
p.small {
font-variant: small-caps;
// Font Size
p.p1 {
font-size: 15px;
p.p2 {
font-size: large;
p.p3 {
font-size: 150%;
</style>
</head>
<body>
<h1>The font-family</h1>
<h1>The font-style</h1>
<h1>The font-variant</h1>
<h1>The font-size</h1>
</body>
</html>
a) Ordered list
<!DOCTYPE html>
<html>
<head>
<title>Ordered List</title>
</head>
<body>
<h1>List of CS Subjects</h1>
<li>HTML</li>
<li>Java</li>
<li>Data Structure</li>
<li>C Programming</li>
<li>Python</li>
</ol>
</body>
</html>
b) Unordered list
<!DOCTYPE html>
<html>
<head>
<title>Unordered List</title>
</head>
<body>
<h1>List of CS Subjects</h1>
<ul type="circle">
<li>HTML</li>
<li>Java</li>
<li>Data Structure</li>
<li>C Programming</li>
<li>Python</li>
</ul>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
#grad1 {
height: 200px;
background-color: red;
background-image: linear-gradient(to right, red, orange, yellow, green, blue, indigo, violet);
</style>
</head>
<body>
Rainbow Background
</div>
</body>
</html>
a) Delay
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 100px;
height: 100px;
background-color: red;
position: relative;
animation-name: example;
animation-duration: 4s;
animation-delay: 2s;
}
@keyframes example {
0% {background-color:red; left:0px; top:0px;}
25% {background-color:yellow; left:200px; top:0px;}
50% {background-color:blue; left:200px; top:200px;}
75% {background-color:green; left:0px; top:200px;}
100% {background-color:red; left:0px; top:0px;}
}
</style>
</head>
<body>
<h1>CSS Animation</h1>
<p>The animation-delay property specifies a delay for the start of an animation. The following example has a 2
seconds delay before starting the animation:</p>
<div> </div>
</body>
</html>
b) Direction
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 100px;
height: 100px;
background-color: red;
position: relative;
animation-name: example;
animation-duration: 4s;
animation-direction: reverse;
@keyframes example {
</style>
</head>
<body>
<h1>CSS Animation</h1>
<p>The animation-direction property specifies whether an animation should be played forwards, backwards or in
alternate cycles. The following example will run the animation in reverse direction (backwards):</p>
<div></div>
</body>
</html>
c) Duration
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 100px;
height: 100px;
background-color: red;
animation-name: example;
animation-duration: 4s;
@keyframes example {
0% {background-color: red;}
</style>
</head>
<body>
<h1>CSS Animation</h1>
<div> </div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 100px;
height: 100px;
background: red;
position: relative;
@keyframes mymove {
</style>
</head>
<body>
<h1>Demonstration of keyframes</h1>
<div></div>
</body>
</html>
<!DOCTYPE html>
<html>
<center>
<head>
<style>
div {
width: 100px;
height: 100px;
background: green;
div:hover {
width: 300px;
height: 300px;
transform: rotate(180deg);
</style>
</head>
<body>
<p>click the below animation to see the Transition and Transformation effect:</p>
<div></div>
</body>
</center>
</html>
7) Write a HTML/5 program to turn on/off a light bulb using JavaScript. Make use of .gif image and
buttons.
<!DOCTYPE html>
<html>
<body>
<center>
<script>
function light(value)
var pic;
if (value == 0)
pic= "bulboff.gif";
else
pic= "bulbon.gif";
document.getElementById('bulb').src=pic;
</script>
</center>
</body>
</html>