Slide 4.1: Programming Exercise II: A static bookstore using CSS
Slide 4.3: CSS syntax
Home

CSS (Cascading Style Sheet)


What Is CSS? A CSS Example

     


Styles Solved a Big Problem.
HTML was never intended to contain tags for formatting a document. HTML was intended to define the content of a document, like:
     <h1>This is a heading</h1>
     <p>This is a paragraph.</p>
When tags like <font>, and color attributes were added to the HTML 3.2 specification, it started a nightmare for web developers. Development of large web sites became a long and expensive process. To solve this problem, the W3C created CSS. In HTML 4.0, all formatting could be removed from the HTML document, and stored in a separate CSS file.

CSS Saves a Lot of Work!
CSS defines how HTML elements are to be displayed. Styles are normally saved in external .css files. External style sheets enable you to change the appearance and layout of all pages in a web site, just by editing one single file!


Demonstration
The following demonstration shows how the script of HTML and CSS is displayed on the Web: