Sample Video Frame
03: Rule Sets
div > a selector only works on the "first child" when I should have said "immediate descendents". The second mistake is I claim that div > a has higher specificity than div a but it doesn't, it's simply order dependent. If you reorder those lines you should get the same effect. The important part of the video is that div > a solves situations where div a is too aggressive and applies to all a tags when you only want the immediate children.Now I start to show you the most basic element of CSS and how it interacts with the HTML Document Object Model (DOM). When we talked about the DOM in the HTML module I showed you how the HTML tags are structured into a tree, with parents and children. The problem with trees is they're difficult to process without some kind of "rules engine". A rules engine is a way to specify what should happen when certain things are encountered in a tree. You give the browser a set of rules, the browser "walks" the DOM, and if any part of the DOM matches your rule, then the browser runs it.
Register for The Pro-Webdev Mega Bundle
Register today for the course and get the all currently available videos and lessons, plus all future modules for no extra charge.