Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
• What is DHTML?
• What makes a web page dynamic?
• Components in a DHTML
• Steps for developing CSS
• Using CSS in the HTML
• CSS Test Drive
• Another Example
Learning Outcomes (cont.)
• Linking CSS file externally
• Complete Example
• Creating different styles for same
element
• Elaborating classes
• Adding classes to HTML
• Adding styles to <div>
Learning Outcomes (cont.)
• Adding CSS to Descendant elements
• Adding Styles to tables
• An example
• DHTML Advantages and
Disadvantages
What is DHTML?
• A term that denotes HTML in a dynamic
form
• It is a combination of style sheets and
scripts that allows documents to be
animated.
What makes a web page
dynamic?
• Interactivity
• Synchronicity
• Flexibility
• Adaptability
• Activity
Components of DHTML
padding-right: 20px;
padding-bottom: 20px;
padding-left: 20px;
margin-left: 20px;
text-align : center;
background-image : url(images/my.gif);
}
Add CSS To Descendant
Elements
html
body
h1 h2 div id=mydiv
h2 h3 h3
• Writing a descendant selector
div h2 {
color : red;
}
This rule says to select any <h2> that is a
descendant of a <div>.
• When we have an id for the element
#mydiv h2 {
color : red ;
}
This rule says to select any <h2> that is
descendant of an element with id “mydiv”.
Adding styles to tables
....
<table>
<tr class=“cellcolor”>
<td class=“columncolor”>…</td>
<td>…</td>
</tr>
<tr class=“cellcolor1”>
<td class=“columncolor” >…</td>
<td>…</td>
</tr>
</table>
An Example
CSS(style.css)
#header{
font-family : courier,comic
sans,times new roman;
color: red;
text-decoration:underline;
}
#header1{
font-family : courier,comic
sans,times new roman;
color:blue;
font-size : 20px;
}
#header2{
font-family : courier,comic
sans,times new roman;
color:#aaabbb;
font-size : 20px;
}
.cellheader{
background-color :#cc6600;
}
.cellcolor1{
background-color : #fffa7a;
}
.cellcolor {
background-color : #fcba7a;
}
.center_font{
font-family : courier,comic
sans,times new roman;
text-align: center;
}
caption{
font-family : courier,comic
sans,times new roman;
color:red;
font-size : 20px;
}
table {
margin-left: 10px;
margin-right:10px;
border: thin solid black;
caption-side:bottom;
}
HTML(index.html)
<html><head>
<title>CSS EXAMPLE</title>
<link type="text/css" rel="stylesheet"
href="style.css"/>
</head>
<body>
<div style="position: absolute; width:
593px; height: 34px; z-index: 1;
left:197px; top:26px;" id="header">
<h1>Sikkim in India</h1>
</div>
<div style="position: absolute; width:
595px; height: 22px; z-index: 2; left:
197px; top: 96px" id='header1'>
<h2>Documenting my trip to
Sikkim</h2>
</div>