03: Rule Sets

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.

Your Files Are a Tree

A simpler way to explain trees is to use what you know about the command line from the First Steps module. If you remember you can use a command like this:

cd Projects/ljsthw/ex1

Learn JavaScript Today

Register today for the Beginner Basics course and get the new releases by just paying the difference. There's also special discounts for existing customers when new courses are released.


Still Not Sure? Check out more curriculum!