zoukankan      html  css  js  c++  java
  • svg

    !DOCTYPE html>
    <head>
    <meta charset="UTF-8">
    </head>
    <html>
    <body>
    <div>
    <div>M = 移至</div>
    <div>L = 画线</div>
    <div>H = 竖画线</div>
    <div>V = 垂直画线</div>
    <div>C = 曲线</div>
    <div>S = 光滑的曲线</div>
    <div>Q = 二次贝塞尔曲线</div>
    <div>T = 光滑二次贝塞尔曲线</div>
    <div>A = 椭圆的弧</div>
    <div>Z = 关闭路径</div>
    <b style="color: red;">注:以上所有命令均允许小写字母。大写表示绝对定位,小写表示相对定位。</b>
    </div>
    <svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="600" width="450">
    <path id="lineAB" d="M 100 350 l 150 -300" stroke="red" stroke-width="3" fill="none" />
    <path id="lineBC" d="M 250 50 l 150 300" stroke="red" stroke-width="3" fill="none" />
    <path d="M 175 200 l 150 0" stroke="green" stroke-width="3" fill="none" />
    <path d="M 100 350 q 150 -300 300 0" stroke="blue" stroke-width="5" fill="none" />
    <path d="M 100 350 q 150 300 300 0" stroke="pink" stroke-width="5" fill="none" />
    <!-- Mark relevant points -->
    <g stroke="black" stroke-width="3" fill="black">
    <circle id="pointA" cx="100" cy="350" r="3" />
    <circle id="pointB" cx="250" cy="50" r="3" />
    <circle id="pointC" cx="400" cy="350" r="3" />
    <circle id="pointD" cx="250" cy="500" r="3" />
    </g>
    <!-- Label the points -->
    <g font-size="30" font="sans-serif" fill="black" stroke="none" text-anchor="middle">
    <text x="100" y="350" dx="-30">A</text>
    <text x="250" y="50" dy="-10">B</text>
    <text x="400" y="350" dx="30">C</text>
    <text x="250" y="500" dY="30">D</text>
    </g>
    </svg>


    <br><br><br><br>
    <svg>

    <defs>
    <linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="0%">
    <stop offset="0%" style="stop-color:rgb(255,255,0);stop-opacity:1"/>
    <stop offset="100%" style="stop-color:rgb(255,0,0);stop-opacity:1"/>
    </linearGradient>
    </defs>

    <ellipse cx="200" cy="70" rx="85" ry="55" fill="url(#grad1)"/>
    //在svg内添加文本,
    <text fill="#ffffff" font-size="45" font-family="Verdana" x="150" y="86">
    SVG
    </text>
    </svg>
    <p>椭圆。rx="85" ry="55":椭圆宽高;cx="200" cy="70":椭圆的起始点位置。</p>
    <p>linearGradient:渐变</p>
    <em style="color: blue;">在svg标签内部不能添加与svg标签不相关的其他标签,否则不能svg标签没有效果</em>


    </body>
    </html>
    没有人能一路单纯到底,但是要记住,别忘了最初的自己!
  • 相关阅读:
    循环语句格式
    使用switch编写一个购物管理系统
    浅谈Spark(1)
    Java内存回收优化及配置
    同步、异步、阻塞、非阻塞IO
    安装聊天软件telegram-cli
    linux命令行下使用vboxmanage安装linux系统
    昨天晚上写了个 Python 程序,下载了一个图片网站 5000 来张图片
    git使用代理clone加速
    smtp发送邮件记得结尾发送" . "
  • 原文地址:https://www.cnblogs.com/LindaBlog/p/10195154.html
Copyright © 2011-2022 走看看