html 5新特性 用SVG绘制的微信logo_html/css_WEB-ITnose

php中文网
发布: 2016-06-24 11:27:28
原创
1472人浏览过

一个简单的svg绘制图片的小案例。

效果图:

Remove.bg
Remove.bg

AI在线抠图软件,图片去除背景

Remove.bg 174
查看详情 Remove.bg

代码如下:

 1 <style> 2         * { 3             padding: 0; 4             margin: 0; 5         } 6  7         body { 8             background-color: #d5d3d4; 9         }10 11         .container {12             width: 500px;13             height: 500px;14             position: relative;15             top: 80px;16             left: 50%;17             transform: translate3d(-50%,0,0);18             background-color:#08c406;19             border-radius: 10px;20             box-shadow: 0 0 5px #c2bfbf;21         }22         .container object{23             position:relative;24             top:50px;25             left:50px;26         }27     </style>
登录后复制
<body>    <div class="container">        <object data="logo.svg" width="400" height="400" type="image/svg+xml" />    </div></body>
登录后复制

这个是xml格式的代码,跟html文档分离的。

立即学习前端免费学习笔记(深入)”;

 1 <?xml version="1.0" standalone="no"?> 2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"  3 "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> 4  5 <svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg"> 6     <ellipse cx="150" cy="150" rx="150" ry="110" style="fill:rgb(255,255,255);stroke:rgb(255,255,255);stroke-width:2"/> 7     <circle cx="90" cy="105" r="15" style="fill:#08c406;stroke:#08c406;stroke-width:2"/> 8     <circle cx="210" cy="105" r="15" style="fill:#08c406;stroke:#08c406;stroke-width:2"/> 9     <polygon points="50,260 80,195 180,200" style="fill:#fff;stroke:#fff;stroke-width:1"/>10 11     <ellipse cx="268" cy="228" rx="125" ry="90" style="fill:#08c406;stroke:#08c406;stroke-width:2"/>12     <ellipse cx="270" cy="230" rx="125" ry="90" style="fill:rgb(255,255,255);stroke:rgb(255,255,255);stroke-width:2"/>13     <circle cx="220" cy="200" r="10" style="fill:#08c406;stroke:#08c406;stroke-width:2"/>14     <circle cx="320" cy="200" r="10" style="fill:#08c406;stroke:#08c406;stroke-width:2"/>15     <polygon points="330,260 350,320 300,300" style="fill:#fff;stroke:#fff;stroke-width:1"/>16 </svg>
登录后复制
微信app下载
微信app下载

微信是一款手机通信软件,支持通过手机网络发送语音短信、视频、图片和文字。微信可以单聊及群聊,还能根据地理位置找到附近的人,带给大家全新的移动沟通体验,有需要的小伙伴快来保存下载体验吧!

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号