-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathinlinesvg.html
49 lines (41 loc) · 968 Bytes
/
inlinesvg.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
<!doctype html>
<head>
<meta charset="utf-8">
<title>SVG as Foreground image</title>
<body>
<h1>Clown Car Technique</h1>
<svg style="width: 50%; height: auto;"
viewBox="0 0 300 329" preserveAspectRatio="xMidYMid">
<title>Clown Car Technique</title>
<style>
svg {
background-size: contain;
background-repeat: no-repeat;
outline: solid;
}
@media screen and (max-width: 400px) {
svg {
background-image: url(images/small.png);
}
}
@media screen and (min-width: 401px) and (max-width: 700px) {
svg {
background-image: url(images/medium.png);
}
}
@media screen and (min-width: 701px) and (max-width: 1000px) {
svg {
background-image: url(images/big.png);
}
}
@media screen and (min-width: 1001px) {
svg {
background-image: url(images/huge.png);
}
}
</style>
<rect fill="red" width="100" height="100"/>
</svg>
<p>Resize window or edit CSS to change clowns</p>
</body>
</html>