Created
December 17, 2012 08:53
-
-
Save LeaVerou/4316792 to your computer and use it in GitHub Desktop.
How to visually hide stuff but keep it browser-searchable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div>test1</div> | |
<div>test2</div> | |
<div>test3</div> | |
<div>test4</div> | |
<div><div>test5</div></div> | |
<div>test6</div> | |
<div>test7</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// alert('Hello world!'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"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