Professional Documents
Culture Documents
DYNAMIC HTML
DYNAMIC HTML:
• Dynamic HTML is a collective term for a combination of
Hypertext Markup Language (HTML) tags and options
that can make Web pages more animated and
interactive than previous versions of HTML.
• Much of dynamic HTML is specified in HTML 4.0. Simple
examples of dynamic HTML capabilities include having
the color of a text heading change when a user passes a
mouse over it and allowing a user to "drag and drop" an
image to another place on a Web page.
• Dynamic HTML can allow Web documents to look and
act like desktop applications or multimedia
productions.
• With CSS, you can control the color, font, the size of text,
the spacing between elements, how elements are
positioned and laid out, what background images or
background colors are to be used, different displays for
different devices and screen sizes, and much more!
Using CSS
UNIT IV-INTRODUCTION TO WEB DESIGN
DYNAMIC HTML
CSS can be added to HTML documents in 3 ways:
Inline CSS
Example
<h1 style="color:blue;">A Blue Heading</h1>
Example
UNIT IV-INTRODUCTION TO WEB DESIGN
DYNAMIC HTML
<!DOCTYPE html>
<html>
<head>
<style>
body {background-color: powderblue;}
h1 {color: blue;}
p {color: red;}
</style>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
External CSS
Example
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
UNIT IV-INTRODUCTION TO WEB DESIGN
DYNAMIC HTML
<html>
<body>
<script type="text/javascript">
document.getElementById("header").innerHTML="New
Header";
</script>
</body>
</html>
HTML output:
New Header
Collections :
EVENT HANDLING:
An HTML event can be something the browser does, or
something a user does.
HTML VS XML:
UNIT IV-INTRODUCTION TO WEB DESIGN
DYNAMIC HTML
There are many differences between HTML (Hyper Text Markup
Language) and XML (eXtensible Markup Language). The
important differences are given below:
1) HTML is used to display data and XML is a software and hardware independent tool use
focuses on how data looks. transport and store data. It focuses on what data
2) HTML is a markup language itself. XML provides a framework to define markup lang
5) HTML has its own predefined tags. You can define tags according to your need.
6) In HTML, it is not necessary to use a XML makes it mandatory to use a closing tag.
closing tag.
7) HTML is static because it is used to XML is dynamic because it is used to transport data
display data.
SYNTAX OF XML:
The syntax rules of XML are very simple and logical. The rules
are easy to learn, and easy to use.
UNIT IV-INTRODUCTION TO WEB DESIGN
DYNAMIC HTML
XML DTD:
DTD ELEMENTS:
• Empty Elements
Empty elements are declared with the category keyword
EMPTY:<!ELEMENT element-name EMPTY>
Example:
<!ELEMENT br EMPTY>
XML example:
<br />
Type Description
Value Explanation