views:

140

answers:

3

The CSS3 Specifications are in the main browsers partly implemented and you get very nice results with less code, but there are many reasons not to use CSS3. E.g. not downwardly compatible, probably not similar renderd views on different browsers, etc.

So I'm asking myself: Which is the best way to use CSS3 anyway with a option to intercept default problems, like I've discribed above?

A: 

If your making a public website then you have to support ie6, which means no css 2.1, let alone 3.

One thing you can try is: lesscss

This will let you use shorthand css notation and "compile" it to valid css on build.

Andrew Bullock
IE6 is dead, long live IE6! ;-)
IrishChieftain
+1  A: 

You might find "When can I use..." useful for seeing what features you can reasonably use.

Guffa
Great link. You'll need a lot of patience to wait for IE7 to expire though!
Skilldrick
+4  A: 

As long as your site degrades gracefully there's nothing wrong with using CSS3 now. Afterall, if a browser does not understand a particular CSS rule it will just ignore it:

#foo {
    border:1px solid #000; /* shown by all browsers */
    border-radius:5px; /* shown if browser understands border-radius */
    -moz-border-radius:5px; /* Firefox only */
    -webkit-border-radius:5px; /* Safari and Google Chrome */
}

As long as the site does not look broken in browsers that don't support the CSS3 rules you want to use then you should be ok progressively enhancing your site in the browsers that do support them.

Ian Oxley
Yes sure, you are absolutely right, but let me give an example: You have a specific design, e.g. a box with rounded corners and a shadow (css 3 spec: border-radius and box-shadow) and you want this design, as well a browser can't display/render it. How is it possible to ensure this design? My first thought is to implement a second css layout and consider on the head of the page which to use. - But is this reasonable or a good programming approach?
ChrisBenyamin
@Chris This is the point of progressive enhancement - the fully featured browsers will show the best version, with bells and whistles, and the older browsers will show an adequate but less beautiful version. You can't make it look the same in all browsers and use all the new features.
Skilldrick
@ChrisBenyamin Like @Skilldrick says, "You can't make it look the same in all browsers and use all the new features". And don't forget, most users don't view sites in multiple browsers, so as long as it doesn't look broken then you should be ok using as much CSS3 as you like.
Ian Oxley