chris at seberino.org ()
2010-07-17 01:12:05 UTC
I was naively creating and defining all my CSS classes globally.
When you are first learning web programming, it is enough accomplishment just
to get a CSS class working.
However, I tried to emulate what I saw in Google's CSS code and now I'm hooked.
They are very good about nesting classes and ids and even using multiple
classes on an HTML element. For example, often in their
CSS code you'll see stuff that only applies to a specific div inside a specific
id contained in yet another div and id....etc.
My old way has all the problems as using globals in other programming
languages. Google's method has all the benefits we've come to love from
encapsulation in other languages.
I don't know if everyone else knew this already but I was amazed how much
easier it was to code my web app and how much cleaner the logic was.
cs
When you are first learning web programming, it is enough accomplishment just
to get a CSS class working.
However, I tried to emulate what I saw in Google's CSS code and now I'm hooked.
They are very good about nesting classes and ids and even using multiple
classes on an HTML element. For example, often in their
CSS code you'll see stuff that only applies to a specific div inside a specific
id contained in yet another div and id....etc.
My old way has all the problems as using globals in other programming
languages. Google's method has all the benefits we've come to love from
encapsulation in other languages.
I don't know if everyone else knew this already but I was amazed how much
easier it was to code my web app and how much cleaner the logic was.
cs