Forum Moderators: not2easy

Message Too Old, No Replies

Why was tan hack used instead of conditional comments?

         

fuzziman

4:06 am on Aug 8, 2006 (gmt 0)

10+ Year Member



Hi!

I'm just starting to learn about CSS hacks, and I have a quick question. Why did the community use hacks like the Tan Hack to declare IE styles rather than a conditional comment?

I'm reading now that to support IE7, people should fix their CSS to use conditional comments, but if it has been around since IE5/win , why didn't they use them originally?

Thanks!

encyclo

10:21 am on Aug 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The original Tan hack included a fix for Opera 5, which was affected by the same problem as IE5 (a deliberate choice by Opera). There is no-one left using Opera 5 now, so there is no need to correct for it.

doodlebee

6:17 pm on Aug 8, 2006 (gmt 0)

10+ Year Member



Also, back then, conditional comments were not widely known about. IE didn't promote it or make it public knowledge. When they started blogging about IE7, they let people know that if they utlizied the conditional comment, things would be good. But originally, it wasn't something that was widely known about it. (They didn't *hide* it or anything, but it wasn't common knowledge like it is now.)

SuzyUK

9:34 pm on Aug 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Without techniques like the Tan Hack (and your forebears use of them) CSS wouldn't be where it is today.

Workarounds and Hacks taught most of the early birds how it should work, there's nothing like taking something apart to figure out how it works ;)

Now in return you need to do the same, don't learn the hacks... learn the how and the why (they were used) but more importantly learn how to deal with the same situations today.

IE conditionals are not a hack but they are nothing more than IE's way out.. they made a bad choice with their CSS support but they did create a back door... conditionals are not "the right way" to do things but damn they're good and nowadays they will work! If you want to understand CSS unfortunately that means you need to know it's history, and you might need to understand why IE (in quirks rendering mode) ever needed a box model hack in the first place ~ (that'll be where we had to use a tan hack previously)

This need for hacks or understanding has not gone away as far as I know, unless everyone has suddenly started to make sure their pages are in Strict rendering mode?

And you thought you'd asked a "quick" question ;)

[edited by: SuzyUK at 9:35 pm (utc) on Aug. 8, 2006]