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 the presentation format for the document, and Javascript to define
behaviors in response to user events.
Note that the example also demonstrates the separation of these functions 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, decreasing page load times and decreasing
server CPU load.
References: