1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns=
"http://www.w3.org/1999/xhtml" xml:
lang=
"en" lang=
"en">
5 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8"/>
6 <title>SVG clip-path CSS transform
</title>
7 <style type=
"text/css" media=
"screen">
9 -webkit-box-sizing: border-box;
14 display: inline-block;
22 background-color: silver;
23 border:
1px solid black;
32 border:
1px dotted black;
33 -webkit-transform-origin: top left; /* to match SVG */
36 svg { width:
100%; height:
100% }
39 border:
1px solid blue;
47 <h2>SVG CSS scale
</h2>
48 <div class=
"container">
49 <svg xmlns=
"http://www.w3.org/2000/svg" xmlns:
xlink=
"http://www.w3.org/1999/xlink">
51 <circle id=
"circle1" cx=
"10" cy=
"10" r=
"20" style=
"transform:scale(5)"/>
52 <clipPath id=
"clip-circle1">
53 <use xlink:
href=
"#circle1"/>
56 <rect id=
"rect" x=
"10" y=
"10" width=
"200" height=
"200" fill=
"green" clip-path=
"url(#clip-circle1)"/>
61 <div class=
"container">
62 <svg xmlns=
"http://www.w3.org/2000/svg" xmlns:
xlink=
"http://www.w3.org/1999/xlink">
64 <circle id=
"circle2" cx=
"10" cy=
"10" r=
"20" transform=
"scale(5)"/>
65 <clipPath id=
"clip-circle2">
66 <use xlink:
href=
"#circle2"/>
69 <rect id=
"rect" x=
"10" y=
"10" width=
"200" height=
"200" fill=
"green" clip-path=
"url(#clip-circle2)"/>
75 <h2>SVG CSS compound
</h2>
76 <div class=
"container">
77 <svg xmlns=
"http://www.w3.org/2000/svg" xmlns:
xlink=
"http://www.w3.org/1999/xlink">
79 <rect id=
"rect1" x=
"1" y=
"1" width=
"40" height=
"40" style=
"transform:rotate(45deg) scale(5)"/>
80 <clipPath id=
"clip-rect1">
81 <use xlink:
href=
"#rect1"/>
84 <rect id=
"rect" x=
"10" y=
"10" width=
"200" height=
"200" fill=
"green" clip-path=
"url(#clip-rect1)"/>
89 <div class=
"container">
90 <svg xmlns=
"http://www.w3.org/2000/svg" xmlns:
xlink=
"http://www.w3.org/1999/xlink">
92 <rect id=
"rect2" x=
"1" y=
"1" width=
"40" height=
"40" transform=
"rotate(45) scale(5)"/>
93 <clipPath id=
"clip-rect2">
94 <use xlink:
href=
"#rect2"/>
97 <rect id=
"rect" x=
"10" y=
"10" width=
"200" height=
"200" fill=
"green" clip-path=
"url(#clip-rect2)"/>