-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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] 第28天 rgba()和opacity这两个的透明效果有什么区别呢? #99
Comments
1. 扩展: |
回复@xiangshuo1992 |
@hbl045 隐藏元素也可以 |
@xiangshuo1992 如果是占位隐藏 用overflow:hidden 在通过margin、padding 设置负值,这样也能达到隐藏,不过我是觉得有点多余了。在面试问答中,也可以作为一种思考的答案,虽然不是最优解。 |
rgba一般是针对颜色属性进行透明度的设置,而opacity相对来说比较霸道他会将整体都变为透明状态 |
|
补充: rgba和opacity的透明度可以叠加(乘算) |
opacity是对于一个元素,并具有继承性 |
1.opacity 是属性,rgba()是函数,计算之后是个属性值; |
rgba作用于元素的颜色及其背景色,opacity作用于元素,以及元素内的所用内容的透明度 |
第28天 rgba()和opacity这两个的透明效果有什么区别呢?
The text was updated successfully, but these errors were encountered: