Skip to content

[css] 第206天 如果给一个元素设置background-color,它的颜色会填充哪些区域呢? #1493

Open
@haizhilin2013

Description

@haizhilin2013
Collaborator

第206天 如果给一个元素设置background-color,它的颜色会填充哪些区域呢?

我也要出题

Activity

wheatup

wheatup commented on Nov 8, 2019

@wheatup

background填充区域默认为content、padding和border区域。
然而该行为由background-clip属性决定,默认为border-box

该属性对应的 background 填充对应区域如下:

background-clip margin border padding content text
border-box (默认) -
padding-box -
content-box -
text (webkit)
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@wheatup

        Issue actions

          [css] 第206天 如果给一个元素设置background-color,它的颜色会填充哪些区域呢? · Issue #1493 · haizlin/fe-interview