E Tensible Yper Arkup Anguage:: X H T M L
E Tensible Yper Arkup Anguage:: X H T M L
E Tensible Yper Arkup Anguage:: X H T M L
CSS
INFO202 Lynda Hodgson Summer 2010
Anatomy of a Rule
Selector: element tag or part of the page to which the rule is applied
enclosed in brackets separated by commas have values Specified after the colon Terms with spaces are enclose in quotes
You can build one that works for ALL of your companys pages!
Here is an example
Separate the rules for the same selector with a semicolon Pepper liberally with comments to help you figure out what you were trying to do later! Color names Safe fonts
No comments about my artistic design capabilities, please! If you can do better, SHOW ME!
font-size align decorate text (underline, line through, overline) indent boldness style (italics) All font properties at once Background image For a complete list, refer to the W3C
Style
Internal/Embedded Styles
If multiple pages will use it, put it in an external CSS to eliminate redundant code
Fancier stuff
Inline Styles
USE SPARINGLY IF AT ALL For occasional short text that is unique in the overall web site and unlikely to be used elsewhere Specify the style right in the tag!
<p style="color: green; font-family: serif "> This is a short text </p>
Style is an attribute of the tag
Rules are used like attribute values
<p> This sentence contains a <span style="font-size:150%"> big </span> word </p>
Span tags
Rule
Altogether now...
Embedded/Internal Style sheet
Inline Style
Browser
Defaults
External
Precedence
Used if there are no overrides
Embedded
Single element
In-line
Your turn
You now have the tools to enhance your pages. Time to get to work!