SVG Tutoriallogin
SVG Tutorial
author:php.cn  update time:2022-04-18 17:51:50

SVG curve



SVG Curve - <polyline>

Example 1

The<polyline> element is used to create any shape with only straight lines:

02.jpg

The following is the SVG code:

Example

<!DOCTYPE html>
<html>
<body>

<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
  <polyline points="20,20 40,25 60,40 80,120 120,140 200,180" style="fill:none;stroke:black;stroke-width:3" />
</svg>

</body>
</html>

Run Example»

Click the "Run Instance" button to view the online instance

F For Opera users: View the SVG file (right-click on the SVG graphic preview source).


Example 2

Another example with only straight lines:

50.jpg

Here is the SVG code:

Instance

<!DOCTYPE html>
<html>
<body>

<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
  <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>

</body>
</html>

Run Instance»

Click the "Run Instance" button to view the online instance

F For Opera User: View SVG file (right click on SVG graphic preview source).

php.cn