Web Assignment
Web Assignment
Web Assignment
COURSE CODE=CoSc
IN NUMBER= 2126
Title: Multimedia, HTML Graphics, and HTML Frames
Table of Contents:
1. Introduction
3. HTML Graphics
3.1.2 Example
3.2.2 Example
4. HTML Frames
4.4 Examples
5. Conclusion
6. References
1. Introduction:
HTML (Hypertext Markup Language) is a standard markup language used for creating web pages. In this
short note, we will explore three important aspects of HTML: inserting multimedia, HTML graphics using
HTML Canvas and SVG, and creating HTML frames. We will delve into the syntax, usage, and provide
examples for each concept.
2. Inserting Multimedia in HTML:
Multimedia elements such as images, audio, and video enhance the user experience on web pages.
HTML provides several tags to embed multimedia content. The <embed>, <audio>, and <video> tags are
commonly used for this purpose.
The <embed> tag allows you to embed multimedia content directly into an HTML page. It supports
various multimedia types such as images, audio, video, and flash. Here is an example of using the
<embed> tag to insert an image:
Example of Embedded
<!DOCTYPE html>
<html>
<head>
<title>Image Example</title>
</head>
<body>
<h1>Embedding an Image</h1>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<body>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Audio Example</title>
</head>
<body>
<h1>Including Audio</h1>
</body>
</html>
Example 2: Adding Audio Controls:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
</audio>
</body>
</html>
The <video> tag is used to embed videos in HTML pages. It supports various video formats such as MP4,
WebM, and OGG. Here is an example of using the <video> tag to insert a video:
<!DOCTYPE html>
<html>
<head>
<title>Video Example</title>
</head>
<body>
<h1>Embedding a Video</h1>
</html>
<!DOCTYPE html>
<html>
<head>
</head>
<body>
</video>
</body>
</html>
3. HTML Graphics:
HTML provides powerful tools for creating graphics within web pages. The two main approaches are
HTML Canvas and SVG (Scalable Vector Graphics).
HTML Canvas provides a drawing surface for JavaScript-based graphics and animations. It allows you to
draw shapes, paths, text, and images dynamically. Here is the syntax for using HTML Canvas:
```html
```
<!DOCTYPE html>
<html>
<head>
<title>Canvas Example</title>
<style>
</style>
</head>
<body>
<h1>Canvas Example</h1>
<script>
context.fillStyle = "red";
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Canvas Example</title>
<style>
</style>
</head>
<body>
<h1>Canvas Example</h1>
<script>
context.beginPath();
context.fillStyle = "blue";
context.fill();
</script>
</body>
</html>
3.2 SVG (Scalable Vector Graphics):
SVG is an XML-based language for creating vector graphics. It allows you to define shapes, text, and
images using XML tags. SVG graphics are scalable and can be resized without losing quality. Here is the
syntax for using SVG:
```html
</svg>
```
<!DOCTYPE html>
<html>
<head>
<title>SVG Example</title>
</head>
<body>
<h1>SVG Example</h1>
</svg>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>SVG Example</title>
</head>
<body>
<h1>SVG Example</h1>
</svg>
</body>
</html>
4. HTML Frames:
HTML frames allow you to divide a web page into multiple sections, each displaying a different HTML
document. The main components of HTML frames are the frame set, frames, and internal frame.
To create an HTML frame, you need to use the <frame> tag within a <frameset> tag. The <frame> tag
specifies the content to be displayed withinthe frame. Here is an example of creating a frame:
```html
<frame src="menu.html">
<frame src="content.html">
</frameset>
The frame set defines the layout and structure of frames within a web page. It specifies the size,
position, and number of frames in a frameset. In the example above, we have defined a frameset with
two columns, where the first column occupies 25% of the width and the second column occupies 75% of
the width.
Example
<!DOCTYPE html>
<html>
<head>
<title>HTML Frames</title>
</head>
<noframes>
</noframes>
</frameset>
</html>
An internal frame is a frame that is embedded within another frame. It allows for nesting frames within
frames. Here is an example of using an internal frame
<HTML>
<HEAD>
<TITLE>Frame Example</TITLE>
</HEAD>
</head>
<body>
</iframe>
</body>
</html>