svg 로 다각형 그리기



html)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" 
          content="width=device-width, height=device-height, 
                     minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0">
    <title>Insert title here</title>
</head>
 
<body>
    <?xml version="1.0" ?>
    <svg xmlns="http://www.w3.org/2000/svg" width="300px" height="400px" version="1.1">
        <!-- 
        polygon : 선의 끝부분이 연결된다
            points : 띄어쓰기로 점들을 지정한다
         -->    
        <polygon points="50,50 200,50 250,100 200,150 50,150" 
                 style="fill:orange; stroke:green; stroke-width:5;" />
        
        <!-- 
        polyline : 선의 끝부분이 연결되지 않는다         
            points : 띄어쓰기로 점들을 지정한다
         -->
        <polyline points="50,200 200,200 250,250 200,300 50,300" 
                 style="fill:orange; stroke:green; stroke-width:5;" />
    </svg>
</body>
</html>
cs



결과

'IT > - 프로그래밍' 카테고리의 다른 글

HTML5/CSS3 svg 로 글자쓰기  (0) 2017.07.22
HTML5/CSS3 svg 로 path 요소로 선긋기  (0) 2017.07.21
HTML5/CSS3 svg 로 선그리기  (0) 2017.07.19
HTML5/CSS3 svg 로 타원 그리기  (0) 2017.07.18
HTML5/CSS3 svg 로 원 그리기  (0) 2017.07.17

+ Recent posts