
- 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 - 描邊
SVG 支援多個描邊屬性。
以下是使用的主要描邊屬性。
序號 | 描邊型別及描述 |
---|---|
1 | stroke − 定義文字、線條或任何元素輪廓的顏色。 |
2 | stroke-width − 定義文字、線條或任何元素輪廓的粗細。 |
3 | stroke-linecap − 定義線條或任何路徑輪廓末端的不同型別。 |
4 | stroke-dasharray − 用於建立虛線。 |
示例
testSVG.htm<html> <title>SVG Stroke</title> <body> <h1>Sample SVG Stroke</h1> <svg width="800" height="800"> <g> <text x="30" y="30" >Using stroke: </text> <path stroke="red" d="M 50 50 L 300 50" /> <path stroke="green" d="M 50 70 L 300 70" /> <path stroke="blue" d="M 50 90 L 300 90" /> </g> </svg> </body> </html>
輸出
在 Chrome 瀏覽器中開啟 textSVG.htm。您可以使用 Chrome/Firefox/Opera 直接檢視 SVG 影像,無需任何外掛。Internet Explorer 9 及更高版本也支援 SVG 影像渲染。
描邊寬度
<html> <title>SVG Stroke</title> <body> <h1>Sample SVG Stroke</h1> <svg width="800" height="800"> <text x="30" y="10" >Using stroke-width: </text> <path stroke-width="2" stroke="black" d="M 50 50 L 300 50" /> <path stroke-width="4" stroke="black" d="M 50 70 L 300 70" /> <path stroke-width="6" stroke="black" d="M 50 90 L 300 90" /> </svg> </body> </html>
輸出
在 Chrome 瀏覽器中開啟 textSVG.htm。您可以使用 Chrome/Firefox/Opera 直接檢視 SVG 影像,無需任何外掛。Internet Explorer 9 及更高版本也支援 SVG 影像渲染。
描邊端點
<html> <title>SVG Stroke</title> <body> <h1>Sample SVG Stroke</h1> <svg width="800" height="800"> <g> <text x="30" y="30" >Using stroke-linecap: </text> <path stroke-linecap="butt" stroke-width="6" stroke="black" d="M 50 50 L 300 50" /> <path stroke-linecap="round" stroke-width="6" stroke="black" d="M 50 70 L 300 70" /> <path stroke-linecap="square" stroke-width="6" stroke="black" d="M 50 90 L 300 90" /> </g> </svg> </body> </html>
輸出
在 Chrome 瀏覽器中開啟 textSVG.htm。您可以使用 Chrome/Firefox/Opera 直接檢視 SVG 影像,無需任何外掛。Internet Explorer 9 及更高版本也支援 SVG 影像渲染。
描邊虛線
<html> <title>SVG Stroke</title> <body> <h1>Sample SVG Stroke</h1> <svg width="800" height="800"> <g> <text x="30" y="30" >Using stroke-dasharray: </text> <path stroke-dasharray="5,5" stroke-width="6" stroke="black" d="M 50 50 L 300 50" /> <path stroke-dasharray="10,10" stroke-width="6" stroke="black" d="M 50 70 L 300 70" /> <path stroke-dasharray="20,10,5,5,5,10" stroke-width="6" stroke="black" d="M 50 90 L 300 90" /> </g> </svg> </body> </html>
輸出
在 Chrome 瀏覽器中開啟 textSVG.htm。您可以使用 Chrome/Firefox/Opera 直接檢視 SVG 影像,無需任何外掛。Internet Explorer 9 及更高版本也支援 SVG 影像渲染。
廣告