<svg xmlns="http://www.w3.org/2000/svg">
<rect x="10" y="20" width="100" height="50" style="fill:red;stroke:black;stroke-width:2;" />
<rect x="150" y="20" width="100" height="50" rx="10" ry="10" style="fill:red;stroke:black;stroke-width:2;" />
svg>
以左上角为例,以(x+rx,y+ry)为圆心,rx、ry分别为椭圆水平和垂直半径画一个椭圆,正好与矩形左上角的圆角边重叠。
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<rect x="10" y="10" rx="30" ry="10" width="50" height="100" style="fill:blue;stroke:green;stroke-width:5;opacity:0.9;" />
<ellipse cx="40" cy="20" rx="30" ry="10" style="fill:red;stroke:purple;stroke-width:3;fill-opacity:0.2;stroke-opacity:0.8;" />
svg>
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50" cy="50" r="40" stroke="black" stroke-width="2" fill="red" />
<circle cx="150" cy="50" r="40" stroke="black" stroke-width="2" fill="red" />
<circle cx="150" cy="50" r="30" stroke="black" stroke-width="2" fill="white" />
svg>
<svg xmlns="http://www.w3.org/2000/svg">
<ellipse cx="100" cy="50" rx="80" ry="40" stroke="black" stroke-width="2" fill="red" />
<ellipse cx="300" cy="50" rx="80" ry="40" stroke="black" stroke-width="2" fill="red" />
<ellipse cx="300" cy="50" rx="70" ry="30" stroke="black" stroke-width="2" fill="white" />
svg>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<line x1="30" y1="10" x2="100" y2="100" style="stroke:rgb(255,0,0);stroke-width:2" />
svg>
<html>
<body>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200" height="200">
<polyline points="0,40 40,40 40,80 80,80 80,120 120,120 120,160" style="fill:white;stroke:red;stroke-width:4" />
svg>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200" height="200">
<polyline points="0,40 40,40 40,80 80,80 80,120 120,120 120,160 160,160" style="fill:yellow;stroke:red;stroke-width:4" />
svg>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200" height="200">
<polygon points="0,40 40,40 40,80 80,80 80,120 120,120 120,160 160,160" style="fill:yellow;stroke:red;stroke-width:4" />
svg>
body>
html>
<html>
<body>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200" height="200">
<polygon points="100,10 40,180 190,60 10,60 160,180" style="fill:lime;stroke:purple;stroke-width:5;fill-rule:nonzero;"/>
svg>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200" height="200">
<polygon points="100,10 40,180 190,60 10,60 160,180" style="fill:lime;stroke:purple;stroke-width:5;fill-rule:evenodd;"/>
svg>
body>
html>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<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" />
<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" />
g>
<g font-size="30" font="sans-serif" fill="black" stroke="none" text-anchor="middle">
<text x="100" y="350" dx="-30">Atext>
<text x="250" y="50" dy="-10">Btext>
<text x="400" y="350" dx="30">Ctext>
g>
svg>