学习SVG系列(3):SVG Stroke属性
SVG stroke 属性
1、stroke
2、stroke-width
3、stroke-linecap
4、stroke-dasharray
5、stroke-opacity
6、stroke-linejoin
Stroke 属性
边框色,属性定义一条线,文本或元素轮廓颜色

SVG代码:
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<g fill="none">
<path stroke="red" d="M5 20 l215 0" />
<path stroke="blue" d="M5 40 l215 0" />
<path stroke="black" d="M5 60 l215 0" />
</g>
</svg>
stroke-width属性
stroke-width属性定义了一条线,文本或元素轮廓厚度

SVG代码:
<svg
xmlns="http://www.w3.org/2000/svg" version="1.1">
<g fill="none" stroke="black">
<path stroke-width="2" d="M5 20 l215 0" />
<path stroke-width="4" d="M5 40 l215 0" />
<path stroke-width="6" d="M5 60 l215 0" />
</g>
</svg>
Stroke-linecap属性
Stroke-linecap属性定义线段端点的风格,这个属性可以使用butt/square/round三个值

SVG代码:
<svg
xmlns="http://www.w3.org/2000/svg" version="1.1">
<g fill="none" stroke="black" stroke-width="6">
<path stroke-linecap="butt" d="M5 20 l215 0" />
<path stroke-linecap="round" d="M5 40 l215 0" />
<path stroke-linecap="square" d="M5 60 l215 0" />
</g>
</svg>
stroke-dasharray属性
该属性用于创建虚线:

SVG代码:
<svg
xmlns="http://www.w3.org/2000/svg" version="1.1">
<g fill="none" stroke="black" stroke-width="4">
<path stroke-dasharray="5,5" d="M5 20 l215 0" />
<path stroke-dasharray="10,10" d="M5 40 l215 0" />
<path stroke-dasharray="20,10,5,5,5,10" d="M5 60 l215 0"
/>
</g>
</svg>
stroke-opacity属性
该属性设置边框的透明度,值的范围从0到1

SVG代码:
<svg
width="160" height="280"
xmlns="http://www.w3.org/2000/svg">
<polyline points="40 60 80 20 120 60"
stroke="black" stroke-opacity="1"
stroke-width="10"
fill="transparent" stroke-linejoin="miter" />
<polyline points="40 100 80 60 120 100"
stroke="black" stroke-opacity="0.5"
stroke-width="10" fill="transparent"
stroke-linejoin="round" />
<polyline points="40 140 80 100 120 140"
stroke="black" stroke-opacity="0.1"
stroke-width="10" fill="transparent" stroke-linejoin="bevel"
/>
</svg>
stroke-join属性
该属性设置线条拐弯处的连接方式

SVG代码:
<svg
width="160" height="280"
xmlns="http://www.w3.org/2000/svg">
<polyline points="40 60 80 20 120 60"
stroke="black"
stroke-width="10"
fill="transparent" stroke-linejoin="miter" />
<polyline points="40 100 80 60 120 100" stroke="black" stroke-width="10"
fill="transparent" stroke-linejoin="round" />
<polyline points="40 140 80 100 120 140"
stroke="black"
stroke-width="10" fill="transparent"
stroke-linejoin="bevel" />
</svg>
学习SVG系列(3):SVG Stroke属性的更多相关文章
- SVG 学习<二>进阶 SVG世界,视野,视窗 stroke属性 svg分组
目录 SVG 学习<一>基础图形及线段 SVG 学习<二>进阶 SVG世界,视野,视窗 stroke属性 svg分组 SVG 学习<三>渐变 SVG 学习<四 ...
- 学习SVG系列(4):SVG滤镜效果
注意:Internet Explorer和Safari不支持SVG滤镜 <defs>.<filter> 所有互联网的SVG滤镜定义在<defs>元素中,<fi ...
- 学习SVG系列(1):SVG基础
什么是SVG? 1.指可伸缩矢量图形 2.用来定义用于网络的基于矢量的图形 3.使用XML格式定义图形 4.图像在放大或改变尺寸的情况下其图形不会有所损失 5.万维网联盟的标准, 用于描述二维矢量图形 ...
- 3. svg学习笔记-基本形状和画笔属性
svg中可以绘制的基本图形有线段,矩形,多边形,圆,椭圆,分别来看一下这些基本图形: 线段 使用<line>元素创建一条线段,格式如下: <line x1=" start- ...
- SVG Stroke属性
一.stroke属性介绍 SVG提供了一个范围广泛stroke属性,用于描述轮廓,其中包括 stroke 指定颜色 stroke-width 指定宽度 stroke-linecap 指定端点样式 st ...
- 学习SVG系列(5):SVG渐变
SVG渐变 渐变是一种从一种颜色到另一种颜色的平滑过渡,可以把多个颜色的过渡应用到同一个元素. 渐变有两种: Linear Redial 线性渐变-<linearGradient> lin ...
- SVG系列教程:SVG简介与嵌入HTML页面的方式
地址:http://www.w3cplus.com/html5/svg-introduction-and-embedded-html-page.html 随着技术向前的推进,SVG相关的讨论也越渐频繁 ...
- HTML5 学习03——内联 SVG
什么是SVG? SVG 指可伸缩矢量图形 (Scalable Vector Graphics) SVG 用于定义用于网络的基于矢量的图形 SVG 使用 XML 格式定义图形 SVG 图像在放大或改变尺 ...
- MongoDB学习笔记系列
回到占占推荐博客索引 该来的总会来的,Ef,Redis,MVC甚至Sqlserver都有了自己的系列,MongoDB没有理由不去整理一下,这个系列都是平时在项目开发时总结出来的,希望可以为各位一些帮助 ...
随机推荐
- xtrapivotcontrol 控件用法及相关属性
XtraPivotControl使用指南:可参照以下的文档: 转载自:http://wenku.baidu.com/view/d7886b20aaea998fcc220e53.html 上面链接中对x ...
- java selenium (五) 元素定位大全
页面元素定位是自动化中最重要的事情, selenium Webdriver 提供了很多种元素定位的方法. 测试人员应该熟练掌握各种定位方法. 使用最简单,最稳定的定位方法. 阅读目录 自动化测试步骤 ...
- 需要不断学习的编程知识库list
1.重构思想: 2.回调思想: 3.封装思想: 4.模块化思想: 5.复用思想: 6.C++的面向对象思想: -----后续
- 自定义动画css属性
自定义动画: 1.animation-name(自定义动画名称) 元素所应用的动画名称,必须与@keyframes使用,名称由@keyframes定义. keyframes(动画关键帧):以@keyf ...
- Format函数
Format是一个很常用,却又似乎很烦的方法,本人试图对这个方法的帮助进行一些翻译,让它有一个完整的概貌,以供大家查询之用: 首先看它的声明: function Format(const Format ...
- -bash: msgunfmt: command not found
执行命令:msgunfmt frontend.mo -o frontend.po 解决方法: 安装gettext完成后如下:
- Bootstrap<基础一> CSS 概览
HTML 5 文档类型(Doctype) Bootstrap 使用了一些 HTML5 元素和 CSS 属性.为了让这些正常工作,您需要使用 HTML5 文档类型(Doctype). 因此,请在使用 B ...
- Android studio打开之后 cannot load project: java.lang.NUllpointerException
参考来源:http://bbs.csdn.net/topics/391014393 关闭网络,重新打开Android studio就好了.(但是原因不清楚是为什么?) Internal error. ...
- python学习03——设计,与input有关
笨办法学python第36节,我写的代码如下: from sys import exit def rule(): print "Congratulations! You made the r ...
- 易云盘(nester)-面对企业的和团队文档管理的平台
易云盘(nester)是本人的另外一款作品,先前开发和维护的在线设计工具Visor也已经合并在Nester的最新版里了. 目前作为共享版发布. 特点 Nester后端是以Spring Framewor ...