SVG

SVG įterpimas į dokumentą

Elementas <svg>

 

Atributai:

  • height
  • width
<html>
    <body>
        <svg width="100" height="100">
        </svg>
    </body>
</html>

<rect>

Atributai:

  • height
  • width
  • x
  • y
  • style
<html>
    <body>
        <svg width="100" height="100">
            <rect x="50" y="20" width="50" height="50"
  style="fill:blue;stroke:pink;stroke-width:5;
fill-opacity:0.1;stroke-opacity:0.9" />
        </svg>
    </body>
</html>

<line>

Atributai:

  • x1
  • y1
  • x2
  • y2
  • style
<html>
    <body>
        <svg width="100" height="100">
            <line x1="0" y1="0" x2="50" y2="50" 
style="stroke:rgb(255,0,0);stroke-width:2" />
        </svg>
    </body>
</html>

<polyline>

Atributai:

  • points
  • style
<html>
    <body>
        <svg width="100" height="100">
            <polyline 
  points="20,20 40,25 60,40 80,100"
  style="fill:none;stroke:black;stroke-width:3" />
        </svg>
    </body>
</html>

<polygon>

Atributai:

  • points
  • style
<html>
    <body>
        <svg width="100" height="100">
            <polygon
  points="20,20 40,25 60,40 80,100"
  style="fill:pink ;stroke:black;stroke-width:3" />
        </svg>
    </body>
</html>

<circle>

Atributai:

  • cx
  • cy
  • r
  • style
<html>
    <body>
        <svg width="100" height="100">
            <circle cx="50" cy="50" r="40" stroke="black" stroke-width="3" fill="red" />
        </svg>
    </body>
</html>

S

By Arūnas Liuiza

Loading comments...

More from Arūnas Liuiza