0% found this document useful (0 votes)
13 views11 pages

ASSIGNMENT - Webdevelopment Basics

The document outlines various web development concepts including how to apply CSS to HTML, the definition and integration of DHTML, and the role of XML in data storage and transport. It also explains the handling of multimedia content in HTML, the differences between XML and HTML, and the use of <canvas> and <svg> for graphical content. Additionally, it discusses DTD and XML Schema for XML validation, the transformation of XML using XSL and XSLT, and the role of the DOM in dynamically manipulating HTML and CSS.

Uploaded by

solankisudhir263
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views11 pages

ASSIGNMENT - Webdevelopment Basics

The document outlines various web development concepts including how to apply CSS to HTML, the definition and integration of DHTML, and the role of XML in data storage and transport. It also explains the handling of multimedia content in HTML, the differences between XML and HTML, and the use of <canvas> and <svg> for graphical content. Additionally, it discusses DTD and XML Schema for XML validation, the transformation of XML using XSL and XSLT, and the role of the DOM in dynamically manipulating HTML and CSS.

Uploaded by

solankisudhir263
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

ASSIGNMENT -01 WAD

ASSIGNMENT -2 WAD
________________________________________________________________
__________________
1. How do you apply CSS to an HTML document?
CSS (Cascading Style Sheets) to an HTML document can be done in several
ways:
1. Inline CSS: directly add CSS to HTML elements using the style attribute. This
method is useful for small changes.
<p style="color: blue; font-size: 20px;">This is a paragraph.</p>
2. Internal CSS:include CSS within the <style> tag inside the <head> section of
your HTML document. This is suitable for a single-page styling.
<style>
p {color: blue; font-size: 20px; }
</style>
</head>
3. External CSS: create a separate CSS file (e.g., styles.css) and link it to your
HTML document using the <link> tag. This is the preferred method for larger
websites.
<head>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>

2. Define DHTML and explain how it integrates HTML, CSS, and


JavaScript to
create dynamic and interactive web pages.
DHTML: Dynamic HTML
Dynamic HTML (DHTML) is a term that encompasses a combination of
technologies used to create interactive and dynamic web pages. It integrates
HTML, CSS, and JavaScript to enhance the user experience by providing a more
responsive and engaging interface.
EXAMPLE:
<!DOCTYPE html>
<html>
<head>
<title>DHTML Example</title>
<script>
function changeColor()
{document.getElementById("text").style.color = "blue";}
</script>
</head>
<body>

<p id="text">This is a DHTML example.</p>


<button onclick="changeColor()">Change Color</button>
</body>
</html>

3. What is XML, and how is it used in web development? Provide an


example.
XML (Extensible Markup Language) is used for storing and transporting data. It
is commonly used in data exchange between applications and APIs.
Example:
<person>
<name>Megha </name>
<age>18</age>
</person>
4. How does HTML handle multimedia content?
HTML supports multimedia through <audio>, <video>, and <embed> tags.
Example:
<audio controls>
<source src="audio.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
<video controls>
<source src="video.mp4" type="video/mp4">
</video>
Multimedia elements enhance user experience by allowing media playback
directly
in the browser.
5. Define XML and explain the key differences between XML and HTML.
XML (Extensible Markup Language) is a markup language designed to store,
transport, and
structure data in a human-readable and machine-readable format. It is widely
used for data
exchange between systems.

Feature XML HTML


Purpose Stores and transports data Displays data
in a structured format
Structure U ser-defined tags Predefined
tags
Flexibility Self-descriptive and extensible Fixed tag
meanings
Data Handling Focuses on data storage and
Organization Focuses on
visual representation
Syntax Rules Strict (tags must be closed properly) Less strict
(some tags can be left

open)

Case Sensitivity Case-sensitive Not case-


sensitive
Presentation No built-in formatting Has
formatting rules using CSS &

JavaScript
6. Explain the role of <canvas> and <svg> elements in creating graphical
content in HTML5.
The <canvas> element provides a bitmap-based drawing surface that allows for
dynamic rendering of 2D and 3D graphics using JavaScript.
Features:
• Uses JavaScript to draw shapes, lines, and images.
• Best for real-time animations, game graphics, and visual effects.
• Graphics are raster-based, meaning they are drawn as pixels and cannot be
resized
without losing quality.
• Once drawn, elements cannot be individually manipulated.
Example:
<canvas id="myCanvas" width="200" height="100"></canvas>
The <svg> element is used to create scalable vector graphics, which means the
graphics are defined using XML and do not lose quality when resized.
Features:
• Uses XML syntax to define shapes and images.
• Best for charts, icons, maps, and illustrations.
• Graphics are vector-based, meaning they scale without losing clarity.
• Individual elements can be manipulated using CSS and JavaScript.
Example:
<svg width="100" height="100">
<circle cx="50" cy="50" r="40" fill="blue" />
</svg>
7. Compare DTD and XML Schema, highlighting their roles in defining XML
document structure and validation.
• DTD (Document Type Definition): Defines the structure and rules for an XML
document using a simple, non-XML syntax.
• XML Schema (XSD - XML Schema Definition): Defines the structure, data
types, and
constraints of an XML document using XML syntax.

8. Describe how XML can be transformed using XSL and XSLT.


XSL (Extensible Stylesheet Language) and XSLT (XSL Transformations) are used
totransform XML into other formats like HTML.
Example:
<xsl:template match="/">
<html><body>
<h2>Books:</h2>
<xsl:for-each select="bookstore/book">
<p><xsl:value-of select="title"/></p>
</xsl:for-each>
</body></html>
</xsl:template>

9. Briefly define DOM and discuss its role in accessing and manipulating
HTML
and CSS dynamically.
The DOM (Document Object Model) is a programming interface for web
documents. It represents an HTML or XML document as a tree structure where
each element, attribute, and piece of text is a node. JavaScript can interact with
the
DOM to dynamically access and modify the document’s content, structure, and
styling.
Role of DOM in Accessing and Manipulating HTML and CSS Dynamically:
• Accessing HTML Elements The DOM allows JavaScript to find elements using
methods like getElementById(), querySelector(), etc.
• Modifying Content The text, attributes, and structure of elements can be
changed
dynamically.
• Manipulating CSS Styles JavaScript can modify an element’s styles
dynamically.
• Handling Events The DOM allows adding event listeners to elements for
interactivity.
• Adding and Removing Elements The DOM lets JavaScript create and delete
elements
dynamically.

You might also like