SVG系列一
来源:互联网 发布:数据流图数据字典实例 编辑:程序博客网 时间:2024/06/08 17:44
Note: Since SVG is written in XML, all elements must be properly closed!
<!DOCTYPE html><html><body><h1>My first SVG</h1><svg width="100" height="100"> <circle cx="50" cy="50" r="40" stroke="#000" stroke-width="4" fill="#ccc" /></svg></body></html>
- The cx and cy attributes define the x and y coordinates of the center of the circle. If cx and cy are omitted, the circle's center is set to (0, 0)
- The stroke and stroke-width attributes control how the outline of a shape appears. We set the outline of the circle to a 4px green "border"
但如果是画一个椭圆呢?其实如果用CSS设置它的水平半径和垂直半径就行了border-radius: 50px / 100px;
但有了SVG就可以很简单的画出椭圆以及更复杂的矢量图形了。
<svg width="400" height="200"> <ellipse cx="200" cy="100" rx="180" ry="80" style="fill: #ccc; stroke: #000; stroke-width: 4" /> </svg>
叠层的椭圆
<svg width="400" height="200"> <ellipse cx="190" cy="100" rx="180" ry="30" style="fill: red" /> <ellipse cx="180" cy="70" rx="160" ry="20" style="fill: green" /> <ellipse cx="170" cy="45" rx="140" ry="15" style="fill: blue" /> </svg>
0 0
- SVG系列一
- SVG开发系列(一)
- SVG基础一:认识SVG
- svg系列之polygon
- HTML5系列-SVG了解
- SVG系列二
- javascript 的SVG (一)
- svg学习笔记(一)
- SVG学习(一)
- svg笔记(一)
- SVG 案例一
- SVG,Vector(一)
- svg学习笔记(一)
- jquery 操作 svg (一)
- SVG入门笔记(一)
- svg绘制圆弧(一)
- SVG 贝塞尔曲线学习一
- SVG学习笔记(一)
- 作用域安全的构造函数
- 商品订购及货物采购信息系统(代码分析)
- 一些小记录
- 期货投资分析学习笔记(三)
- 鼠标点击选择行 再次点击取消选择行
- SVG系列一
- POJ 2406 Power Strings(KMP循环节)
- hadoop2.2.0集群搭建(四)终结篇
- Springmock
- html与控制器的关联
- Java学习小知识点
- C语言第三章
- QtChart 初体验
- 给容器快速赋值