Before I dive into some spectacular features of CSS3, let me say something about CSS attributes.
Apparently, the way CSS attributes should be sorted within a CSS class, is a much debated subject. Some people advocate sorting by functional category (in this case grouping first dimensions, then font attributes, then border attributes):
I prefer to sort alphabetically, because it is universal by nature in contrast to sorting by functional category. Of course you could specify an order if you sort by functional category, but that would introduce additional documentation overhead... So I would sort like this:
Although it doesn't really matter which way you sort, it's obviously a good idea to sort consistently within your project.
I make an exception for vendor prefixes. Vendor-prefixes are prefixes for CSS attributes that browser vendors (or manufacturers) use to implement non-standard (or not yet standard) CSS features. Take for example
-moz-border-radius. The vendor prefix -moz is used by Mozilla (for Firefox obviously) and it is their implementation of the border-radius attribute. Once border-radius becomes standard, you can just use border-radius, without the prefix. Because of vendor prefixes, a typical block of CSS attributes might look like this:
In this case, you might understand it to be wise not to sort the vender prefixes alphabetically, but to group them by attribute.
Adobe Flash and images are often used as a workaround for shortcomings of HTML (e.g. to compensate for what now can be done in HTML5 with the <video/> tag) and also for shortcomings for CSS. With CSS3 a lot of features have been added, so the use of images can be reduced even more. I'll give a couple of examples, so you can see for yourself (these examples where meticulously stolen from the presentation by Hakon Wium Lie).
background: green; border: 0.1em dotted blue;
text-shadow: 0px 0px 5px white;
border-radius: 150px / 50px;
box-shadow: 5px 5px 10px white;
box-shadow: 0px 0px 5px 3px green inset;
0px 0px 5px 3px red, 0px 0px 7px 5px green inset
This menu is an image on the Apple site, but pure CSS here:
You may also want to check out this wicked Opera logo fully in CSS.
Although before CSS3 there were some hacks to support custom fonts, now the use of Web Fonts has been standardized:
You can see, I use this all around this site.
It's well known that long lengths of text are more readable when divided across columns, preventing excess horizontal eye movement. This could be solved by using a <table>, but everyone knows that tables are for tabular data, and this is why.
In CSS3 this can also be solved by using the column-width attribute. Unfortunately it is not widely supported yet (it doesn't work in Opera), so it is necessary to use vendor prefixes, e.g.:
CSS Media Queries may be known from constructions to override CSS classes for certain media, e.g. printing or handheld devices, like:
The media type 'handheld' is not of much use anymore these days, because there is no standard resolution for handhelds anymore, if there ever was one.
A more advanced usage is available in CSS3, where conditions can be added to the query:
In this case, when the max-width of the available space drops below 800px, the element 'article' gets another background color then when it would be larger than 800px. Try to resize this page below a width of 800px and see what happens. This can be used to reformat a page for handheld devices purely by using CSS.
Using a separate CSS for printing is not uncommon, but this is an extreme example of how the CSS3 Paged Media module can be used to format a book. On a side note: I'm not under the impression that a lot of browsers support all of the CSS3 Paged Media functions.
This means you can essentially stop thinking about development on a browser level and concentrate on what features you would like to support. HTML5 and CSS3 features can be gradually integrated without losing support for older browsers.