DHTML
DHTML
DHTML
DHTML
Dr Harleen
DHTML
• DHTML = Dynamic HTML
It allows you to build rich client interfaces and to modify
them dynamically
• 2 Modes of Operation
All modern browsers support 2 modes: Standards Mode for
standard-compliant code and "Quirks" Mode for older or
non-compliant code
• Very powerful
CSS is much more powerful than HTML design tags
CSS Example
<STYLE TYPE="text/css">
BODY {
background-color: #CCCCCC;
}
P{
border: 1px solid black;
background-color: #FFFFFF;
margin-bottom: 1em;
}
</STYLE>
What is CSS?
It is a specification controlled by the World
Wide Web Consortium (W3C).
HTML controls the organization of a Web
page document
CSS controls the presentation and layout of
the Web page document elements
What is CSS? ...
CSS1- visual presentation of elements
CSSP - positioning of elements
CSS2 -visual and audio presentation of
elements. It includes attributes from CSS1
and CSS-P
What CSS can do?
With CSS you can separate form from
structure
Control layout (alignment, spacing,
margins, colors, floating elements etc)
Maintain and update many pages faster and
easier
HTML and CSS
• <STYLE> tag
Delineates inline styles
<STYLE TYPE="text/css"> /* Styles go here... */ </STYLE>
• <LINK> tag
References external style sheets. Allows for alternates.
<LINK REL="stylesheet" HREF="default.css" TYPE="text/css">
• STYLE attribute
Defines inline styles for a specific block of HTML code
<P STYLE="color: #FF0000; font-weight: bold;"> some text </P>
CSS: Rule Structure
SELECTOR { DECLARATION }
CSS – Terminology…
Declaration has two parts:
HI {color : green }
property : Value
•In general:
•Element(s) { Property1:Value1; Property2 : Value2a , Value2b
}
Eg.: H1, B {color:olive; background:yellow; font-
family: arial, courier }
CSS-Adding styles to web pages
Four ways
Embed a style sheet within HTML
document
Link to an external stylesheet from the
HTML document
Add styles inline in the HTML document
Importing style sheets
CSS-Embed a style sheet
All stylesheet information lies at the top of the
HTML code (in the head portion)
Eg:
<HTML>
<STYLE TYPE=“text/css”>
<!—
H1 {color: green; font-family: impact}
-- >
</STYLE>
<HEAD>
<BODY> . . .