html 5新特性 --用SVG绘制的微信logo
2016-02-03 13:37
961 查看
一个简单的SVG绘制图片的小案例。
效果图:
代码如下:
这个是xml格式的代码,跟html文档分离的。
效果图:
代码如下:
<style> * { padding: 0; margin: 0; } body { background-color: #d5d3d4; } .container { width: 500px; height: 500px; position: relative; top: 80px; left: 50%; transform: translate3d(-50%,0,0); background-color:#08c406; border-radius: 10px; box-shadow: 0 0 5px #c2bfbf; } .container object{ position:relative; top:50px; left:50px; } </style>
<body> <div class="container"> <object data="logo.svg" width="400" height="400" type="image/svg+xml" /> </div> </body>
这个是xml格式的代码,跟html文档分离的。
<?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg"> <ellipse cx="150" cy="150" rx="150" ry="110" style="fill:rgb(255,255,255);stroke:rgb(255,255,255);stroke-width:2"/> <circle cx="90" cy="105" r="15" style="fill:#08c406;stroke:#08c406;stroke-width:2"/> <circle cx="210" cy="105" r="15" style="fill:#08c406;stroke:#08c406;stroke-width:2"/> <polygon points="50,260 80,195 180,200" style="fill:#fff;stroke:#fff;stroke-width:1"/> <ellipse cx="268" cy="228" rx="125" ry="90" style="fill:#08c406;stroke:#08c406;stroke-width:2"/> <ellipse cx="270" cy="230" rx="125" ry="90" style="fill:rgb(255,255,255);stroke:rgb(255,255,255);stroke-width:2"/> <circle cx="220" cy="200" r="10" style="fill:#08c406;stroke:#08c406;stroke-width:2"/> <circle cx="320" cy="200" r="10" style="fill:#08c406;stroke:#08c406;stroke-width:2"/> <polygon points="330,260 350,320 300,300" style="fill:#fff;stroke:#fff;stroke-width:1"/> </svg>
相关文章推荐
- iOS微信第三方登录实现
- Android第三方支付--微信支付
- 微信企业号开发(六)---邀请成员关注
- 微信企业号开发(五)--成员管理,增删改查
- 为什么微信要将电话功能限制在国外?
- android实现微信自动抢红包
- 微信关闭了QQ好友导入功能
- android 微信支付获取sign的注意事项
- 微信支付错误两个问题的解决:curl出错,错误码:60
- 王学岗ViewPager——仿微信版(一)
- 微信企业号开发(四)-管理部门,增删改查
- audio 自动播放 iPhone微信客户端
- Android-黑科技-微信抢红包必备软件
- 微信公众号变现方式
- 微信生态圈的发展分析
- 微信开放平台全网发布61009错误处理
- 【Android实战】移动支付(微信、支付宝、银联)集成
- 从 0 到 1:微信后台系统的演进之路
- 微信开发中的cdta
- iOS 集成微信开放平台 sdk 编译不过