views:

47

answers:

2

Hello,

Is it a good idea to use experimental CSS-properties like border-radius, text-shadow, box-shadow and gradient in a layout today? And what about values like rgba()?

When I look at web galleries, these CSS-properties are frequently used and according to articles like on 24ways.org it is not a problem to use these properties.

What is your opinion?

+3  A: 

I would say it's a decidedly bad idea to depend on those properties right now. You can use them, but they won't work in many browsers.

Off the top of my head: border-radius, text-shadow and box-shadow and rgba won't work in IE at all. Source for rgba, official IE compatibility table for all CSS properties

Since IE still holds a remarkable share in the browser market, it would be foolish to ignore it.

The nice thing about all those effects is that it is still possible to create a site that looks great with them, and still decent without them. The only exception to that may be rgba depending on the context you use it in.

Pekka
+2  A: 

The CSS standard says: "When a user agent cannot parse the selector (i.e., it is not valid CSS 2.1), it must ignore the selector and the following declaration block (if any) as well.", see http://www.w3.org/TR/CSS21/syndata.html

This means you may use the rgba() and older browsers should ignore that. However, you may provide a fallback value for them (see http://css-tricks.com/rgba-browser-support/ ):

background:#cfdfaf; /*works on old browsers*/
background:rgba(200, 54, 54, 0.5); 
     /*overrides the previous declaration for new browsers*/
naivists