Stylesheet |
A set of rules for formatting a document |
Cascading |
Refers to the ability of stylesheets to inherit characteristics from a previously applied stylesheet while adding or changing rules. |
Linked Stylesheet |
A stylesheet written as a separate document. It is connected to a page by putting in the HEAD of the page: <LINK rel="stylesheet" href="nameOfFile.css" type="text/css"> where "nameOfFile" is the actual name of your file, of course. The styles in a linked stylesheet can therefore be used by many documents. Changing the original stylesheet will automatically change all documents that use it. |
Embedded Stylesheet |
A stylesheet that is defined in the HEAD of the page itself. Applies only to that particular page. Overrides styling from a linked stylesheet. All the rules are written between STYLE tags: <HEAD> <TITLE>My Page</TITLE> <STYLE> .....listing all the rules..... </STYLE> </HEAD> |
Inline Stylesheet |
Styling that is applied within the document text. It overrides both linked and embedded styling, but applies only at that one spot. <SPAN STYLE="color:red"> This SPAN tag would set the text color to red. |
Rule |
A statement of the styles being set. For example:
h3 {color:teal;
is the rule that formats the words on the left on this page.
font-family:"Comic Sans MS", Helvetica, sans-serif; font-size:12pt;} A simple rule has the form: |
Selector |
The part of the rule that states what element of the page the styling will affect. For the rule P {font-size:10pt} P is the selector. This rule sets all paragraphs to 10 points in size. |
Declaration |
The part of the rule that declares what formatting is applied to the selector element. In the h3 example above all the statements between the braces { } form the declaration. A declaration is of the form: property:value
|
Class |
A variation on an element tag. Below we see a rule for ordinary paragraphs and one for a class named second.
P {font-size:12pt;
While the rule for the P element is applied whenever you use the P tag, you must call the class specifically.
To apply the P.second rule, you would use the syntax:
color:blue; font-family:"Times New Roman", Times, serif;} P.second {font-family:Arial, Helvetica, sans-serif} <P CLASS=second> instead of <P> in your document. Note that the P.second rule inherits from the P rule those settings that it didn't specifically reset. So,in this case, using <P class=second> will give you blue 12 point text but in Arial instead of Times New Roman. |
Block-level element |
Elements which result in a new line. Includes those like P DIV H1 BLOCKQUOTE Some properties, like margins, can be set only for block-level elements. |
Script |
A short (relatively) piece of computer code using a scripting language like JavaScript, Visual Basic, or Perl. A script is used to create a response to user actions on the page. JavaScript operates on the viewer's computer, so the browser must support it. Perl, for example, sends info back to the web page's server for action there. |
Syntax Tips | |
| |