-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2-svg-viewbox.html
45 lines (43 loc) · 1.14 KB
/
2-svg-viewbox.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<style>
body{
margin:0;
}
svg{
width: 100%;
box-shadow:0px 0px 20px 0px #0004;
max-width: 800px;
margin:auto;
display: block;
}
#c1{
transition: all .3s;
transform: scale(1);
transform-origin: center;
}
#c1:hover{
transform: scale(2);
fill:red;
}
#r1{
transition: all .3s;
transform: scale(1);
}
#r1:hover{
transform: scale(2);
}
</style>
<svg viewBox="0 0 200 100" id="mySvg">
<line id="l1" x1="0" y1="0" x2="200" y2="100" stroke="black" stroke-width="1"/>
<circle id="c1" cx="100" cy="50" r="40" fill="#f008" stroke="black" stroke-width="1"/>
<rect id="r1" x="100" y="10" width="80" height="80" fill="#00f8" stroke="black" stroke-width="1"/>
</svg>
</body>
</html>