-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsvgfallback.html
60 lines (48 loc) · 1.51 KB
/
svgfallback.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>svg fallback</title>
<style>
img, object, div, svg {
display: block;
width: 48px; height: 48px;
}
div.one {
background-image: url("svgfallback.png");
background-image: url("svgfallback.svg"), linear-gradient(transparent, transparent);
}
div.two {
background: url("svgfallback.png");
background: url("svgfallback.svg"), linear-gradient(transparent, transparent);
}
</style>
</head>
<body>
thanks to <a href="https://css-tricks.com/a-complete-guide-to-svg-fallbacks/">css-tricks.com</a>
<br><br>
<img src="svgfallback.svg" data-fallback="svgfallback.png"> <img>
<br><br>
<picture>
<source type="image/svg+xml" srcset="svgfallback.svg">
<img src="svgfallback.png" alt="">
</picture> <picture>
<br><br>
<object type="image/svg+xml" data="svgfallback.svg">
<img src="svgfallback.png">
</object> <object>
<br><br>
<div class="one"></div> background-image
<br><br>
<div class="two"></div> background
<br><br>
<div>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-20 -20 40 40">
<desc></desc>
<circle fill="limegreen" r="19"/>
<path stroke="forestgreen" fill="none" stroke-width="6" d="M-12,3 L-3,10 11,-12"/>
<text dy="0.35em" text-anchor="middle" font-weight="bold" font-size="18px" font-family="sans-serif" fill="indigo">SVG</text>
</svg>
</div> inline svg
</body>
</html>