CMPT 165 Lecture Notes - Lecture 11: Negative Number
Document Summary
Lecture 11: selector is the thing you want to change. In a contextual selector, there is still only one selector: only changing one thing. Immediate child contextual selector is represented by : to use this there must be immediate parent child relationship, a space can skip a couple levels but the > must be direct child, direct connection on the tree diagram. If there is another tag between the first tag and the next child, it won"t work. In that case it would be the next next child. Id is more specific than class so id overwrites class every time: less specific style rules are ignored. Measuring specificity: an id gets 100, a class gets 10, an element is worth 1, you add up competing tags and the highest one wins, h2 strong = 2 (score, h2, strong = 1. Pseudo-elements: not real, use to style specific parts of a tag i. e. : first-letter.