tags:

views:

99

answers:

5

Hi,

Since I build layouts with css, I always refuse to use css hacks for different browsers.

In your opinion, is there real benefits to use hacks?

Cheers

A: 

The only benefit I can see is saved initial time, so it's acceptable if you want to release something very very quickly. In which case anything is acceptable anyway. But maintaining even a single hack in CSS will be painful.

HeavyWave
+2  A: 

Typically, I would say that their easy and work, that said, there are typically other, more correct ways of addressing whatever issue the developer may be facing.

I found this article about guidelines for using and creating CSS hacks. This most apparent point is

Avoid Targeting Current Versions Of Browsers

which, IMHO, is pretty sound advice. The author also provides an intelligent criteria for what a CSS hack should conform to. Here's an abridged version:

  1. Be valid. Invalid hacks are unacceptable.
  2. Target ONLY older/frozen/abandoned versions of user agents / browsers.
  3. Be ugly.
Justin Johnson
A: 

If by "real benefit" you mean, you'll be able to view your website with that particular effect in browsers that don't actually support it, then yes, it's worth it...

You can say "This car would look nicer in red than in blue, but red is more expensive and takes longer to dry, so i'll go with blue". You make a compromise. If you choose to drop a CSS effect because you'll need to use a hack to make it work in all browsers, then that's your choice. As long as you're comfortable with the compromise of better maintainability for less "zing!".

Tor Valamo
+4  A: 

The benefit of a hack: To deliver

Victor
A: 

If it's a hack that does not have side-effects, or it has been around long enough for the side effects to be known, and it will save me time, I'll go for it without thinking for a second, I don't care if it's invalid.

Mostly IE6 stuff comes to mind, I'm pretty sure that I don't have to fear upgrades breaking the hacks there.

WishCow