Skip to content

Instantly share code, notes, and snippets.

@kshoufer
Created July 13, 2014 01:42
Show Gist options
  • Select an option

  • Save kshoufer/86563e80711864bb3e6c to your computer and use it in GitHub Desktop.

Select an option

Save kshoufer/86563e80711864bb3e6c to your computer and use it in GitHub Desktop.
SVG image wrapped in an anchor tag with hover state.
HTML
<a href=”http://google.com” >
<svg class=”myCSSClass”>
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<rect x="10" y="10" height="100" width="100" style="stroke:#ff0000; fill:#0000ff"/>
</svg>
</a>
CSS
.myCSSClass:hover {
fill:#00ff00;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment