CSS: Controlling Presentation: INFO 1300 September 23, 2009
CSS: Controlling Presentation: INFO 1300 September 23, 2009
So far
h1 { color : #A0BBF2; } p { font-size: 12px; font-family: Verdana, sans-serif; } body { background-color: black; } CSS rules let you style HTML elements
Remember: an ID can only be used in ONE place in an HTML document. But the same ID can be used in multiple HTML documents. And a CSS file using a ID as a selector can be linked to by multiple HTML documents.
Class Syntax
.className {property: value; property:value}!
.contactinfo {color: orange}!
Class vs. id
Use class when you want to affect two or more XHTML elements <p class="caption"> Mod Crusher's Club Jacket </p> .. <p class="caption"> Scooters Outside a Mod Hangout </p>
From this
To this
Tree structure reflects nesting. The children of a parent are those tags nested within it.
Div is a block-level element. It groups items that should be styled together. Like <p>.
Span is an in-line element. It is used to style inside block-level elements. Like <em>.
Caveat on CSS
Beware, or you will rip your hair out
Review
CSS defines rules that change how content is presented
With picky syntax