csstransparent属性_css透明颜⾊transparent的使⽤在css中 transparent到底是什么意思呢? transparent 它代表着全透明⿊⾊,即⼀个类似rgba(0,0,0,0)这样的值。
cssclass属性例如在css属性中定义:background:transparent,意思就代表背景透明。
实际上background默认的颜⾊就是透明的属性,所以写和不写都是⼀样的。
transparent⼀般使⽤场景:
如果⼀个元素覆盖在另外⼀个元素之上,⽽你想显⽰下⾯的元素,这时你就需要把上⾯这个元素的background设置为transparent  transparent在不同css版本中使⽤:
CSS1中,transparent被⽤来作为background-color的⼀个参数值,⽤于表⽰背景透明。
CSS2中,border-color也开始接受transparent作为参数值,《Open eBook(tm) Publication Structure 1.0.1》[OEB101]延伸到color也接受transparent作为参数值。
CSS3中,transparent被延伸到任何⼀个有color值的属性上。
transparent例⼦:
<style>
.dom {
color: transparent;
border: 1px solid transparent;
background: transparent;
}
</style>
<div class="dom">背景,⽂字颜⾊,border透明</div>