Thursday, August 13, 2009

Linking

* There are many advantages to writing CSS styles in a seperate document and then linking this document to all the HTML files in a web application.
* The main advantage is that it allows us to seperate content from presentation.
* We also save band width as the rules need to only be loaded once.
* It saves us time and money (a hosting plan includes both 1. how much data you need on the server and 2. how much data is downloaded form the server).
* You create a more flexible site that is easier to maintain.
* To link the CSS file you insert a link tag into the head element of each HTML document.
* The link tag has four main attributes:
1. rel="stylesheet" (what is the relationship between the linked files).
2. type="text/css" (it's a CSS stylesheet).
3. href="CSS/styles.css" (the location of the CSS document).
4. media="all" (will be explained later).
* This code must be inserted into all documents in the web application.
* Styles are then added to the specified CSS document which will cascade through all the linked pages in the application.

No comments:

Post a Comment