Skip to content

关于fill属性在svg和css中 #98

Description

@ckinmind

fill

// 正常的写法 => <path fill="#fff" ... />
.attr('fill', 'red') => <path style="fill: #fff;" ... />

// 另一种写法
.style('fill', 'red')

两种都是有效的,上面的链接中提到

This will override a presentation attribute <path fill="#fff" ... />

This will not override an inline style e.g. <path style="fill: #fff;" ... />
不是很明白这里什么意思

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions