Hacked to Death iii

While testing Krugle for my pending review I was able to find a Safari hack that works.
You may already have heard of the Safari Stokely Hack. It’s not as straight forward as most IE hacks but it works on even the latest versions of Safari and can be a real life saver.
View details on the Stormdetector website.
Now IE7 is here hacks have to be more specific in their targeting. Some Beta versions of IE7 ignore * html hacks and some apply them (The final release ignores them).
To be sure which browser will be affected by your styles you can use conditional comments.
e.g.
<!--[if lte IE 6]>
(html for IE 6 or older goes here)
<![endif]–>
This goes into your html not your css file. The version(s) of IE you specify will read the code you enter within the comments while other browsers will ignore it. This means you can link to a seperate style sheet with your IE hacks in and it will not affect other browsers.
Selecting versions to affect:
To affect just one version of a browser (e.g. IE7) simply start your conditional comment with <!–[if IE 7]> replacing 7 with whatever browser version you want to target. If you want to target a range of browsers you can insert an extra word before IE.
- lte - less than or equal to
- lt - less than
Because you have targeted a specific set of IE browsers future releases should be happy viewing your page without the hacks getting in the way.
These conditional comments can be used to hide any other html from non-IE browsers too, such as an IE only feature you may have on your page.
Filed under Browsers, Newsflash, Tutorials, hacks |Leave a Reply













