transform变换

translate平移

<svg width="200" height="50">
<rect x="0" y="0" width="20" height="10" fill="red "/>
<rect x="0" y="0" width="20" height="10" transform="translate(10, 20)"/>
</svg>

See the Pen svg-example-17 by flqbestboy
(@fanlinqiang) on CodePen.

rotate旋转

// angle 旋转角度,>0 顺时针
// [centerX, centerY] 旋转中心点
rotate(angle, [centerX, centerY])
<svg width="200" height="50">
<rect x="20" y="0" width="20" height="10" fill="red "/>
<rect x="20" y="0" width="20" height="10" transform="rotate(30)" fill="green"/>
<rect x="20" y="0" width="20" height="10" transform="rotate(-180, 20, 10)"/>
</svg>

See the Pen svg-example-18 by flqbestboy
(@fanlinqiang) on CodePen.

scale缩放

// scaleX,scaleY分别表示水平垂直方向的缩放比例,如0.5表示缩小半
// 若无scaleY则,其值默认等于scaleX
scale(scaleX [, scaleY])
<svg width="200" height="50">
<rect x="20" y="0" width="20" height="10" fill="red "/>
<rect x="40" y="0" width="20" height="10" transform="scale(0.8)" fill="green"/>
<rect x="60" y="0" width="20" height="10" transform="scale(1, 2)"/>
</svg>

See the Pen svg-example-19 by flqbestboy
(@fanlinqiang) on CodePen.

skewXshewY斜切

skewY(angle)
skewX(angle)
<svg width="200" height="50">
<rect x="20" y="0" width="20" height="40" fill="red" transform="skewY(10) skewX(10)"/>
<rect x="40" y="0" width="20" height="40" fill="green" transform="skewY(10)"/>
<rect x="60" y="0" width="20" height="40" transform="skewX(10)"/>
</svg>

See the Pen svg-example-20 by flqbestboy
(@fanlinqiang) on CodePen.

最新文章

  1. 软件工程(FZU2015)赛季得分榜,第三回合
  2. 【C语言入门教程】5.2 函数的作用域规则(auto, static)
  3. Python 基礎 - 變量
  4. safedog的小技巧
  5. tomcat源码解读(2)–容器责任链模式的实现
  6. JQuery(一) 入门
  7. Android中使用WebView与JS交互全解析
  8. UGUI学习之InputField
  9. VC环境下编译OpenSSL(仅仅是个示例,网上还有许多相关文章)
  10. Java I/O之NIO概念理解
  11. Docker初步了解
  12. MySQL 数据类型对比:char 与 varchar;varchar 与 text;datetime 与 timestamp;blob 与 text;
  13. apache 的 配置项
  14. Linux-c系统编程
  15. 解决 ArchLinux 下中文 Chinese 不能输入 couldnt input 的问题
  16. 转 MySQL连接超时
  17. .NET连接MongoDB数据库实例教程
  18. python学习之老男孩python全栈第九期_day021知识点总结——包、异常处理
  19. ubuntu apt-xxx
  20. BigDecimal 执行精确小数计算

热门文章

  1. Django中使用JWT
  2. Ubuntu16.04, CUDA8 CUDNN6 下安装 Tensorflow-gpu, Keras, Pytorch, fastai
  3. Pytohn笔记(31)----第三方包
  4. C# TreeView 右键菜单
  5. 突然萌发关于 redis 的想法(1)
  6. Python中日志logging模块
  7. text-transform
  8. 最短路--SPFA及其优化
  9. KindEditor3.x-自动上传Word图片功能.
  10. P1929 迷之阶梯