Skip to content

Instantly share code, notes, and snippets.

@ahx
Created January 31, 2013 18:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ahx/4685112 to your computer and use it in GitHub Desktop.
Save ahx/4685112 to your computer and use it in GitHub Desktop.
How to add conditional classes to your html tag using HAML. This adds a ie8/i9 class when using IE and nothing when using real browsers. The whole backstory: http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ Yes, i will try Slim next time.
!!!
/[if IE 8] <html class="ie-lt10 ie8" lang="de">
/[if IE 9] <html class="lt-lt10 ie9" lang="de">
:plain
<!--[if gt IE 9]><!--><html lang="de"><!--<![endif]-->
%head
%body
:plain
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment