Skip to content

[css] 第139天 说下background-color:transparent和opacity:0的区别是什么? #1141

Open
@haizhilin2013

Description

@haizhilin2013
Collaborator

第139天 说下background-color:transparent和opacity:0的区别是什么?

Activity

cxwht

cxwht commented on Sep 1, 2019

@cxwht

background-color:transparents是将背景设置为透明,而opacity:0但是将整个块都做透明,包括里面的内容

NicholasBaiYa

NicholasBaiYa commented on Sep 2, 2019

@NicholasBaiYa

background-color:transparents 对应的是背景色(background-color)设为透明;
opacity:0 对应是该元素透明度设为0.(该元素所有内容)

nowherebutup

nowherebutup commented on Sep 2, 2019

@nowherebutup
  • background-color:transparents是将背景色设置为透明,
  • opacity:0包括内容和背景
LinStan

LinStan commented on Sep 2, 2019

@LinStan

background-color:transparents是将背景色设置为透明,内容仍可见。
opacity:0 包括内容和背景全部透明。

Konata9

Konata9 commented on Sep 5, 2019

@Konata9
  • background-color:transparent: 只是把背景色设置为透明,并不会影响元素中的内容。可以利用 transparent 进行三角、扇形的设置。
  • opacity: 0: 会影响整个元素,元素的内容也会被隐去。
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@Konata9@NicholasBaiYa@LinStan@nowherebutup

        Issue actions

          [css] 第139天 说下background-color:transparent和opacity:0的区别是什么? · Issue #1141 · haizlin/fe-interview