SVG <polyline>
SVG 선 - <polyline>
예제 1
<polyline>
요소는 선으로만 구성된 모든 형상(여러 점을 연결하여)을 생성합니다:
이 SVG 코드는 다음과 같습니다:
<svg height="200" width="500"> <polyline points="20,20 40,25 60,40 80,120 120,140 200,180" style="fill:none;stroke:black;stroke-width:3" /> </svg>
코드 설명:
- points 속성은 그려진 선의 필요한 점 목록(x와 y 좌표 쌍)을 정의합니다
예제 2
직선으로만 구성된 또 다른 예제:
이 SVG 코드는 다음과 같습니다:
<svg height="180" width="500"> <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>