that's a really interesting way of writing this code, never seen it like that .
oh and the way i would describe the difference between css and a language like c++ is this:
css is like art design , you get an idea of what you want something to look like then you "draw" it , your brush jsut happens to be a set of orders in a script
C++ on the other hand is like an engineering problem , you want a machine to have a certain function (example: want it to do more than look pretty) you have to build all the parts , put them together right, and then make sure it works with out to many errors .