- SVG 演示
- SVG - 載入器
- SVG - 對話方塊
- SVG - 圖示
- SVG - 時鐘
- SVG - 拖拽
- SVG - 關鍵點
- SVG - 地圖
- SVG - amChart
- SVG - 圖表
- SVG - 平坦表面陰影
- SVG - 影像濾鏡
- SVG - 文字效果
- SVG - 帶 CSS 效果的文字
- SVG - 箭頭效果
- SVG - 品牌效果
- SVG - 果凍效果
- SVG - 漸變效果
- SVG - 活潑效果
- SVG - 滾動效果
- SVG - 幻燈片效果
- SVG - 標籤效果
- SVG - Raphael.js 效果
- SVG - Velocity.js 效果
- SVG - Walkway.js 效果
- SVG - zPath.js 效果
- SVG - Vague.js 效果
- SVG - 變換效果
- SVG - 全屏覆蓋效果
- SVG - Lazylinepainter.js 效果
- SVG - 演示遊戲
- SVG - 即時 SVG 廣告
- SVG 有用資源
- SVG - 常見問題解答
- SVG - 快速指南
- SVG - 有用資源
- SVG - 討論
SVG - 多邊形
<polygon> 元素用於繪製由連線的直線組成的封閉形狀。
宣告
以下是 <polygon> 元素的語法宣告。我們只顯示了主要屬性。
<polygon points="list of points" > </polygon>
屬性
| 序號 | 名稱&描述 |
|---|---|
| 1 | points − 用於構成多邊形的點列表。 |
示例
testSVG.htm<html>
<title>SVG Polygon</title>
<body>
<h1>Sample SVG Polygon Image</h1>
<svg width="800" height="800">
<g>
<text x="0" y="15" fill="black" >Polygon #1: Without opacity.</text>
<polygon points="150,75 258,137.5 258,262.5 150,325 42,262.6 42,137.5"
stroke="black" stroke-width="3" fill="rgb(121,0,121)"></polygon>
</g>
</svg>
</body>
</html>
輸出
在 Chrome 瀏覽器中開啟 textSVG.htm。您可以使用 Chrome/Firefox/Opera 直接檢視 SVG 影像,無需任何外掛。Internet Explorer 9 及更高版本也支援 SVG 影像渲染。
具有不透明度的多邊形
<html>
<title>SVG Polygon</title>
<body>
<h1>Sample SVG Polygon Image</h1>
<svg width="800" height="800">
<g>
<text x="0" y="15" fill="black" >Polygon #2: With opacity </text>
<polygon points="150,75 258,137.5 258,262.5 150,325 42,262.6 42,137.5"
style="fill:rgb(121,0,121);stroke-width:3;
stroke:rgb(0,0,0);stroke-opacity:0.5;opacity:0.5"></polygon>
</g>
</svg>
</body>
</html>
輸出
在 Chrome 瀏覽器中開啟 textSVG.htm。您可以使用 Chrome/Firefox/Opera 直接檢視 SVG 影像,無需任何外掛。Internet Explorer 9 及更高版本也支援 SVG 影像渲染。
svg_shapes.htm
廣告