Class 2 > Apply CSS
Applying CSS to your HTML file
Internal Style Sheets
CSS can be put in the top of your HTML file surrounded by the style tag:
<style type="text/css"> </style>
External Style Sheets
Although this is fine for a single web page, professional web sites deserve to be treated professionally - create one or more separate files and reference it in the header of each page of the site.
- Save your css file as *.css, e.g. basic.css or custom.css
- Link to it in the header of your html file like this:
<link rel="stylesheet" type="text/css" href="basic.css" media="screen" />
Note that you can have different styles for print and other devices by using a different media code - Load both files to the server
- Use more than one file if you like. You might put your everyday things about font and sizing into a basic file that you always use, then have a custom file for specific sites. Just make sure to have the more specific one listed second so it overrides the first in case of conflict
Page Updated
12.08.2009
