© 2010 by Addison Wesley Longman, Inc
© 2010 by Addison Wesley Longman, Inc
1 Introduction
http://jigsaw.w3.org/css-validator/
validator-upload.html
- Inline:
- Style sheet appears as the value of the style
attribute
- General form:
style = "property_1: value_1;
property_2: value_2;
…
property_n: value_n"
- Document-level:
h1, h3
p
- Contextual selectors
ol ol li
2. Class Selectors
- For example,
- For example,
3. Generic Selectors
- Example,
.sale { … }
4. id Selectors
- General form:
#specific-id {property-value list}
- Example:
#section14 {...}
5. Universal Selectors
* {color: red;}
- Applies to all elements in the document
- URL values
- url(protocol://server/pathname)
- Colors
- Color name
- rgb(n1, n2, n3)
- Numbers can be decimal or percentages
- Hex form: #XXXXXX
- font-size
- Font variants
- font-style
- font
- Unordered lists
- Bullet can be a disc (default), a square, or a
circle
- Example:
- 216 colors
- Use hex color values of 00, 33, 66, 99, CC,
and FF
___________________________________________
- background-repeat property
- background-position property
<p>
Now is the <span> best time </span> ever!
</p>
...
<p>
Now is the
<span class = "bigred">
best time </span> ever!
</p>
- Sources of conflict:
- Resolution mechanisms:
a. id selectors
c. Contextual selectors
d. Universal selectors