-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
35 lines (35 loc) · 831 Bytes
/
index.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
<html>
<head>
<style>
.container {
width: 100px;
}
.background-icon {
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 100 100'> <use xlink:href='sprite.svg#my-rectangle'></use> </svg>");
width: 100px;
height: 100px;
}
</style>
</head>
<body>
<h3>Normal SVG inclusion</h3>
<div class="container">
<img src="sprite.svg" />
</div>
<h3>Circle definition</h3>
<div class="container">
<svg viewBox="0 0 100 100">
<use xlink:href="sprite.svg#my-circle"></use>
</svg>
</div>
<h3>Rectangle definition</h3>
<div class="container">
<svg viewBox="0 0 100 100">
<use xlink:href="sprite.svg#my-rectangle"></use>
</svg>
</div>
<h3>Background SVG (not working)</h3>
<div class="background-icon">
</div>
</body>
</html>