Skip to content

[css] 第169天 你了解css3的currentColor吗?举例说明它的作用是什么? #1284

Open
@haizhilin2013

Description

@haizhilin2013
Collaborator

第169天 你了解css3的currentColor吗?举例说明它的作用是什么?

Activity

wwqin

wwqin commented on Oct 2, 2019

@wwqin

currentColor是 color 属性的值,具体意思是指:currentColor关键字的使用值是 color 属性值的计算值。如果currentColor关键字被应用在 color 属性自身,则相当于是 color: inherit。
它的作用在我看来是指定默认color的值,比如

.active{
  color:#C60;
  border:thin  solid;
}
.active{
  color:#C60;
  border:thin  solid currentColor;
}

上述代码中的currentColor代替了#C60

vkboo

vkboo commented on Oct 2, 2019

@vkboo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @haizhilin2013@vkboo@wwqin

        Issue actions

          [css] 第169天 你了解css3的currentColor吗?举例说明它的作用是什么? · Issue #1284 · haizlin/fe-interview