Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
haizhilin2013 opened this issue Sep 1, 2019 · 5 comments
Labels
css css

Comments

@haizhilin2013
Copy link
Collaborator

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

@haizhilin2013 haizhilin2013 added the css css label Sep 1, 2019
@cxwht
Copy link

cxwht commented Sep 1, 2019

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

@NicholasBaiYa
Copy link

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

@nowherebutup
Copy link

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

@Konata9
Copy link

Konata9 commented Sep 5, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css css
Projects
None yet
Development

No branches or pull requests

6 participants
@haizhilin2013 @Konata9 @NicholasBaiYa @nowherebutup @cxwht and others