Introduction to CSS

HTML: Marks the different parts of a document; no control over how it is displayed in a browser
CSS: Determines how the document will be displayed in a browser
Render: The process of a browser applying CSS to the HTML elements; how the document looks in the browser
The browser needs a style sheet specifying the appearance of each page element

Style Rule, page 144

A style rule contains a list of style properties to a selector; the selector is an element or group of elements
Example: selector {
property1: value1;
property2: value2;
}

Applying Stylesheets

The style sheet loaded last has the highest priority.
The "default" sheet provided by the browser is loaded first and has the lowest priority.
To load an extenal sheet, use:
<link href="style.css" rel="stylesheet" type="text/css" />

Embedded Styles, page 148

Styles are loaded directly in the "head" element, using style:
<style>
style rules
</style>

Return to WebDesign Main Section