Skip to content

Instantly share code, notes, and snippets.

@LeaVerou
Created December 17, 2012 08:53
Show Gist options
  • Save LeaVerou/4316792 to your computer and use it in GitHub Desktop.
Save LeaVerou/4316792 to your computer and use it in GitHub Desktop.
How to visually hide stuff but keep it browser-searchable
/**
* How to visually hide stuff but keep it browser-searchable
*/
body > div:nth-of-type(1) { display: none; }
body > div:nth-of-type(2) { visibility: hidden; }
body > div:nth-of-type(3) { height: 0; overflow: hidden; }
body > div:nth-of-type(4) { position: absolute; clip: rect(0,0,0,0) }
body > div:nth-of-type(5) { overflow: hidden; }
body > div:nth-of-type(5) > div { height: 0; }
body > div:nth-of-type(6) { height: 1px; overflow: hidden; }
body > div:nth-of-type(7) { opacity: 0; }
<div>test1</div>
<div>test2</div>
<div>test3</div>
<div>test4</div>
<div><div>test5</div></div>
<div>test6</div>
<div>test7</div>
// alert('Hello world!');
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment