SVG <polygon>
<polygon> 태그는 세 개 이상의 변을 가진 그래픽을 생성하는 데 사용됩니다。
<polygon> 태그
<polygon> 태그는 세 개 이상의 변을 가진 그래픽을 생성하는 데 사용됩니다。
아래 코드를 메모장에 복사한 후 파일을 "polygon1.svg"로 저장하세요. 이 파일을 웹 디렉토리에 넣으세요:
<?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"> <polygon points="220,100 300,210 170,250"} style="fill:#cccccc; stroke:#000000;stroke-width:1"/> </svg>
코드 설명:
points 속성은 다각형 각角的 x 및 y 좌표를 정의합니다
아래 예제는 사각형을 생성합니다:
<?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"> <polygon points="220,100 300,210 170,250 123,234" style="fill:#cccccc; stroke:#000000;stroke-width:1"/> </svg>