Wdes105 day 4

159 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
159
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Wdes105 day 4

  1. 1. WDES105Day 4 -- CSS Rules of Rule Conflict about.me/babon
  2. 2. Topics● Specificity● Importance (point system)● Cascade● Debugging Internet Explorer about.me/babon
  3. 3. SpecificitySpecificity is a mechanism within the CSScascade that aids conflict resolution."When two or more declarations that apply tothe same element, and set the same property,have the same importance and origin, thedeclaration with the most specific selector willtake precedence." about.me/babon
  4. 4. SpecificityExample:● Four style rules that have a selector that matches p elements.● All four rules contain a color property declaration.● Which rule wins? about.me/babon
  5. 5. SpecificityAnswer:● The most specific selector’s declaration will take precedence.specificity.html about.me/babon
  6. 6. SpecificityHow to measure specificity (additional info):1. Start at 0.2. Add 1000 for inline style attribute.3. Add 100 for each ID.4. Add 10 for each attribute, class or pseudo- class.5. Add 1 for each element name or pseudo- element. about.me/babon
  7. 7. ImportanceAn important declaration can be used tooverride specificity (additional info).Add "!important" to the end of a declarationbefore the semicolon.importance.html about.me/babon
  8. 8. CascadeThe cascade is a set of rules for determiningwhich style properties get applied to anelement. about.me/babon
  9. 9. CascadeDeclarations are sorted in the following order(from lowest to highest priority): user agent declarations normal declarations in user style sheets normal declarations in author style sheets important declarations in author style sheets important declarations in user style sheets about.me/babon
  10. 10. CascadeThe declaration with the highest priority isapplied to the element.See the cascade in effect by using firebug.importance.htmladditional info about.me/babon
  11. 11. Debugging Internet ExplorerAccess Applications > VirtualBoxAccess IETester about.me/babon

×