Hacked to Death iii

November 24th, 2006

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.

Have your say?

Comments welcome - you don't have to agree :)

Name (required)

Email (required)

Website


Speak your mind

Trackback URL | Comments RSS

    About

    Although originally designed to document my work and new web development tricks I learnt it has expanded to cover tech and news that I find interesting so in addition to tutorials and interviews expect to see product reviews and tech news too. If you enjoy please comment. David

    Blogroll
    • Adele Kirby - Freelance Writer and most chipper/perky person alive
    • Alex Pullin - Freelance Tech Writer and former PR queen
    • Display: Block - Blog of fellow developer Savell Martin
    • Molly E. Holzschlag - Web standards advocate and Genious
    • Nate Laxon - Funny guy and music guru
    • Paul Boag - Helping website owners and promoting webstandards. The King of Web Design Podcasts
    • Poached Online - news/current affairs/political comment: no eggs
    • Tale of 2 Blogs - Blog about my other blogs
    Admin
  • From Display:Block
    • SpringWidgets
      RSS Reader
      This widget is the staple of our platform. Read all your feeds right here with this one widget - Supported feeds are OPML, RSS, RDF, ATOM. Watch your favorite Podcast in the embedded Video Player on the Desktop or publish your own video playlist to your site for others to view!
      Visit the Widget Gallery