第139天 说下background-color:transparent和opacity:0的区别是什么?
Activity
cxwht commentedon Sep 1, 2019
background-color:transparents是将背景设置为透明,而opacity:0但是将整个块都做透明,包括里面的内容
NicholasBaiYa commentedon Sep 2, 2019
background-color:transparents 对应的是背景色(background-color)设为透明;
opacity:0 对应是该元素透明度设为0.(该元素所有内容)
nowherebutup commentedon Sep 2, 2019
LinStan commentedon Sep 2, 2019
background-color:transparents是将背景色设置为透明,内容仍可见。
opacity:0 包括内容和背景全部透明。
Konata9 commentedon Sep 5, 2019
background-color:transparent
: 只是把背景色设置为透明,并不会影响元素中的内容。可以利用transparent
进行三角、扇形的设置。opacity: 0
: 会影响整个元素,元素的内容也会被隐去。