Skip to content
Sections
Personal tools
You are here: Home » Members » sbaldwin's Home » Courses » Quick CSS Tutorial

Quick CSS Tutorial

Document Actions
A quick introduction to externally-linked cascading style sheets

Back to ENGL303

How to use external stylesheets

1) Create a stylesheet file and apply it to your html pages. The stylesheet must be formatted as text and be saved as filename.css (where filename is whatever you want to call the file).

2) The content of the stylesheet is whatever style information you apply to your documents. The stylesheet does not need html tags, etc. For an examples look at http://www.as.wvu.edu/~sbaldwin/styles.css. And here's a file that applies styles.css: style1.

3) The stylesheet can redefine existing styles or define new styles (the example above does both).<

Created by sbaldwin
Last modified 2007-02-13 11:28 AM

code

Posted by sbaldwin at 2007-02-13 10:53 AM
Here's sample code for the header:
<link href="filename.css" rel="stylesheet" type="text/css">
This tag will apply a cascading stylesheet called filename.css to your document. Note: the link tag is not a container (no </link> needed).

custom styles

Posted by sbaldwin at 2007-02-13 11:05 AM
One way to apply a custom style is inside a div. You do this by setting the ID of the div, for example:

<div id=content>

This applies the content style to the div.
 

Powered by Plone

This site conforms to the following standards: