Skip to content

Instantly share code, notes, and snippets.

@Eccenux
Created October 19, 2016 20:41
Show Gist options
  • Save Eccenux/6b0125d6239c8b6553c93b755fac2c2d to your computer and use it in GitHub Desktop.
Save Eccenux/6b0125d6239c8b6553c93b755fac2c2d to your computer and use it in GitHub Desktop.
With/without JS styling
<!-- with and without JS visibility and display -->
<style type="text/css">
.withJSvisible {visibility: hidden}
.withJSdisplay {display:none}
</style>
<script type="text/javascript">
document.write(String.fromCharCode(60),'style type="text/css"',String.fromCharCode(62),
' .withJSvisible {visibility:visible !important} ',
' .withoutJSvisible {visibility:hidden !important} ',
' span.withJSdisplay,a.withJSdisplay {display:inline !important} p.withJSdisplay,div.withJSdisplay {display:block !important} ',
' .withoutJSdisplay {display:none !important} ',
String.fromCharCode(60),'/style',String.fromCharCode(62)
);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment