OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <style> | |
5 | |
6 .box { | |
7 position: absolute; | |
8 background-color: lime; | |
9 width: 70px; | |
10 height: 40px; | |
11 line-height: 40px; | |
12 transform-origin: 20% 40%; | |
13 | |
14 /* The midpoint of the path is (350, 150). | |
15 Subtract (20% * 70px, 40% * 40px). */ | |
16 transform: translate(336px, 134px) rotate(135deg); | |
alancutter (OOO until 2018)
2015/07/03 03:08:05
You can just add a translate(-20%, -40%) here inst
Eric Willigers
2015/07/03 03:31:38
Done.
| |
17 } | |
18 | |
19 </style> | |
20 </head> | |
21 <body> | |
22 <div class="box">@</div> | |
23 <svg width="700" height="300" viewBox="0 0 700 300"> | |
24 <path stroke="green" d="M 500 0 L 200 300" /> | |
25 </svg> | |
26 </body> | |
27 </html> | |
OLD | NEW |