Created
April 17, 2013 14:54
-
-
Save gonzomir/5404958 to your computer and use it in GitHub Desktop.
Clickable SVG image with PNG fallback.
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Clickable SVG with PNG fallback</title> | |
<style> | |
a { position: relative; z-index: 1; } | |
a span { display: inline-block; } | |
a object { position: relative; z-index: -1; } | |
</style> | |
</head> | |
<body> | |
<h1>Example of clickable SVG image with PNG fallback</h1> | |
<p>The solution of the problem with clickable <code>object</code> elements is from <a href="http://stackoverflow.com/a/12732030">this answer on Stack Overflow</a>.</p> | |
<a href="#"> | |
<span> | |
<object src="image.svg" type="image/svg+xml"> | |
<img src="image.png"> | |
</object> | |
</span> | |
</a> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
In my humble opinion, it should be object data and not object src.