<?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"> <!-- Filters --> <defs> <!--高斯模糊--> <filter id="Gaussian_Blur"> <feGaussianBlur in="SourceGraphic" stdDeviation="3" /> </filter> <!--水平线性渐变--> <linearGradient id="h_orange_red" 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> <!--垂直线性渐变--> <linearGradient id="v_orange_red" x1="0%" y1="0%" x2="0%" y2="100%"> <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> <!--放射性渐变--> <radialGradient id="grey_blue" cx="50%" cy="50%" r="50%" fx="50%" fy="50%"> <stop offset="0%" style="stop-color:rgb(200,200,200); stop-opacity:0"/> <stop offset="100%" style="stop-color:rgb(0,0,255); stop-opacity:1"/> </radialGradient> <!--Fill patterns--> <pattern id="diagonalHatch" patternUnits="userSpaceOnUse" width="3" height="3" patternTransform="rotate(135 2 2)"> <path d="M -1,2 l 6,0" stroke="#000000" stroke-width="1"/> </pattern> </defs> <!--Test Filters--> <ellipse cx="200" cy="150" rx="70" ry="40" style="fill:#ff0000;stroke:#000000; stroke-width:2;filter:url(#Gaussian_Blur)"/> <ellipse cx="200" cy="190" rx="85" ry="55" style="fill:url(#h_orange_red)"/> <ellipse cx="10" cy="190" rx="85" ry="55" style="fill:url(#v_orange_red)"/> <ellipse cx="10" cy="300" rx="85" ry="55" style="fill:url(#grey_blue)"/> <!--End of Test Filters--> <!--矩形--> <rect x="0" y="0" width="200" height="50" rx="20" ry="20" fill="url(#diagonalHatch)" /> <!--圆--> <circle cx="25" cy="25" r="25"/> <!--椭圆--> <ellipse cx="250" cy="25" rx="100" ry="25" fill="green"/> <!--直线--> <line x1="0" y1="0" x2="500" y2="50" stroke="red"/> <!--虚线--> <line x1="50" x2="260" y1="500" y2="500" stroke="#5184AF" stroke-width="2" stroke-linecap="round" stroke-dasharray="1, 3"/> <!--文本--> <text x="250" y="25">zjhiphop</text> <!--多线段--> <polyline points="0,0 0,20 20,20 20,40 40,40 40,60"/> <!-- 路径 : M = moveto L = lineto H = horizontal lineto V = vertical lineto C = curveto S = smooth curveto Q = quadratic Belzier curve T = smooth quadratic Belzier curveto A = elliptical Arc Z = closepath --> <path d="M153 334 C153 334 151 334 151 334 C151 339 153 344 156 344 C164 344 171 339 171 334 C171 322 164 314 156 314 C142 314 131 322 131 334 C131 350 142 364 156 364 C175 364 191 350 191 334 C191 311 175 294 156 294 C131 294 111 311 111 334 C111 361 131 384 156 384 C186 384 211 361 211 334 C211 300 186 274 156 274 Z" style="fill:grey;stroke:red;stroke-width:2"/> <!--Animation--> <rect xmlns="http://www.w3.org/2000/svg" id="rec" x="300" y="100" width="100" height="100" style="fill:lime"> <animate attributeName="x" attributeType="XML" begin="0s" dur="6s" fill="freeze" from="100" to="200"/> <animate attributeName="y" attributeType="XML" begin="0s" dur="6s" fill="freeze" from="100" to="200"/> <animate attributeName="width" attributeType="XML" begin="0s" dur="6s" fill="freeze" from="0" to="100"/> <animate attributeName="height" attributeType="XML" begin="0s" dur="6s" fill="freeze" from="0" to="100"/> <animateColor attributeName="fill" attributeType="CSS" from="lime" to="red" begin="2s" dur="4s" fill="freeze"/> </rect> <g xmlns="http://www.w3.org/2000/svg" transform="translate(100,100)"> <text id="TextElement" x="0" y="0" style="font-family:Verdana;font-size:24; visibility:hidden"> It's SVG! <set attributeName="visibility" attributeType="CSS" to="visible" begin="1s" dur="5s" fill="freeze"/> <animateMotion path="M 0 0 L 100 100" begin="1s" dur="5s" fill="freeze"/> <animateColor attributeName="fill" attributeType="CSS" from="red" to="blue" begin="1s" dur="5s" fill="freeze"/> <animateTransform attributeName="transform" attributeType="XML" type="rotate" from="-30" to="0" begin="1s" dur="5s" fill="freeze"/> <animateTransform attributeName="transform" attributeType="XML" type="scale" from="1" to="3" additive="sum" begin="1s" dur="5s" fill="freeze"/> </text> </g> </svg>
circle{ stroke-width:2px; stroke: red; fill: black; } polyline { fill:grey; stroke:red; stroke-width:2; }