First HTML Document
This document has been structured, styled, and given behavior in
three seperate files:
-
First.html provides structure and
content.
-
First.css defines presentation
format through a series of cascading styles.
-
First.js defines javascript event
handlers responsible for changing presentation properties
on list items on mouseover and mouseout, and showing an
alert when the first heading is clicked.
This example demonstrates using HTML to establish document
structure and content, using CSS to set presentation format
for the document, and Javascript to define behaviors in
response to user events.
Note that the example also demonstrates separation of these
responsibilities into their own modules. This establishes
two important characteristics for this document:
-
Changes to style or behavior need to be made in only one
place, even if many documents use these styles and behaviors.
-
On the first document load, the style file, First.css, and
Script file, First.js, will be loaded. On subsequent loads
of any document that uses these files, they will be drawn
from the browser's cache, rather than loaded from the server,
decreasomg page load times and server CPU load.