Professional Documents
Culture Documents
Lecture17 ConflictResolution
Lecture17 ConflictResolution
Conflict
Resolution
Some Concepts
origin& merge&
inheritance& specificity&
Origin Precedence (when in conflict)
simple&rule!
Last&Declara4on&Wins&
! Remember, HTML is processed sequentially,
top to bottom.
! For precedence, think of external CSS as
declared at the spot where it’s linked to.
Origin Precedence (when no conflict)
even&simpler&rule!
Declara4ons&Merge&
Inheritance
body&
element&
DOM& element&
Tree& element&
element&
element&
Specificity
simple&rule!
Most&Specific&&
Selector&Combina4on&Wins&
Specificity (score)
Class,!pseudo,
style=“…” ID class,!a.ribute #&of&Elements
Class,!pseudo,
style=“…” ID class,!a.ribute #&of&Elements
X! #myParag {
div div.big p {
}
color: blue; ?& }
color: green;
NEXT:
Styling Text