Skip to content

Instantly share code, notes, and snippets.

@LeaVerou
Last active September 15, 2017 23:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LeaVerou/243039b59787053ab84f07dc5d1717c1 to your computer and use it in GitHub Desktop.
Save LeaVerou/243039b59787053ab84f07dc5d1717c1 to your computer and use it in GitHub Desktop.
Dynamic :target
/**
* Dynamic :target
*/
body > * {
font-size: 200%
}
div { background: #eee }
div:target { background: orange }
<div>Foo</div>
requestAnimationFrame(x => document.querySelector("div").id = location.hash.slice(1));
{"view":"split","fontsize":"110","seethrough":"","prefixfree":"","page":"javascript"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment