如何使笔触数组在路径上看起来与在行上相同 [英] How to get stroke-dasharray to look the same on path as it does on line

查看:67
本文介绍了如何使笔触数组在路径上看起来与在行上相同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建路径为16像素,间隙为14像素的虚线图案.我尝试使用:

I'm trying to create a dashed pattern with 16px of path and then a 14px gap. I've tried using:

stroke-dasharray: 16px 14px;

对我的<line>元素有效,但似乎对我的<path>元素没有任何作用.

which works on my <line> element but doesn't seem to do anything on my <path> element.

这是一个玩弄的小提琴: http://jsfiddle.net/Wexcode/avTY6/

Here's a fiddle to play with: http://jsfiddle.net/Wexcode/avTY6/

推荐答案

您在彼此的顶部有两个弧,略有偏移.另外,路径默认情况下用黑色填充(线条不使用填充). 似乎与您想要的有关

You've got two arcs over the top of each other slightly offset. In addition paths are filled by default with black (lines don't use fill). This seems to be about what you want

这篇关于如何使笔触数组在路径上看起来与在行上相同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆