CSS 2.1 is basically a
bugfix release, incorporating errata, adding a few features already widely implemented in browsers and removing a few unused properties. CSS 3 has quite a few new and exciting features, such as border-radius (ooh!), opacity (ooh!) and multiple background images (aaah!).
I guess if I were choosing one to study now, I'd go for CSS 2.1 because this is what most modern browsers support (largely). But this of course brings us on to one of the big issues with standards like this: if a property in CSS 2.1 isn't supported by browsers, it's useless.
I try to follow the W3C standards partly because it feels right and makes me happy, but mainly because most browsers try to adhere to them (predictable behaviour now) and are increasingly doing so over time (predictable behaviour in the future). Or to put it another way, I do it because the browsers (collectively) do it like that, not because W3C does.
I often use the opacity, despite it being a CSS 3 property, because I know most browsers today support it (and for IE, I use -ms-filter: "progid: DXImageTransform.Microsoft.Alpha(opacity=50)" because it works and doesn't upset other clients). I've also used border-radius (together with -moz-border-radius and -webkit-border-radius) because I know that will work nicely in Firefox, Safari and Chrome, and that Opera and IE will just display a square box.
Keeping an eye on CSS 3 developments and browser support is not a bad idea -
this page has a long list of features and current browser support (though may be out of date, as IE8 isn't there and Fx 3.1/3.5 may not be either.
Edit: Oops, I missed the pick browsers link at the top). I've also just found
this page of CSS 3 previews. It's also perhaps worth mentioning that JavaScript libraries such as jQuery add support for quite a few of the CSS 3 selectors (:nth-child, :checked, etc.) and other stuff today.
And while I'm wittering on, don't forget about the whole
XHTML 2 vs HTML 5 thing too.
Edit: UA = user agent, or browser.
Quote:
|
A user agent is any program that interprets a document written in the document language and applies associated style sheets according to the terms of this specification. A user agent may display a document, read it aloud, cause it to be printed, convert it to another format, etc.
|