Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Simple example of CSS that shows/hides elements based on the browser
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>Open Link in IE</title>
<meta name="author" content="Søren Lund">
<!-- We expect IE browser -->
<style>span.showIE { display: inline } span.hideIE { display: none }</style>
<!-- Reverse the logic for non-IE browsers -->
<!--[if !IE]><!-->
<style>span.showIE { display: none } span.hideIE { display: inline }</style>
<span class="showIE">Please try this: <a href="">Google</a></span>
<span class="hideIE">You need to open IE and copy this link into the address field:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment