首页 > Web开发 > 详细

css transparent属性_css 透明颜色transparent的使用

时间:2020-07-03 13:54:49      阅读:106      评论:0      收藏:0      [点我收藏+]

在css中 transparent到底是什么意思呢? transparent 它代表着全透明黑色,即一个类似rgba(0,0,0,0)这样的值。

例如在css属性中定义:background:transparent,意思就代表背景透明。

实际上background默认的颜色就是透明的属性,所以写和不写都是一样的。

 

transparent一般使用场景:

如果一个元素覆盖在另外一个元素之上,而你想显示下面的元素,这时你就需要把上面这个元素的background设置为transparent

资源网站搜索大全https://55wd.com

 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>

 

css transparent属性_css 透明颜色transparent的使用

原文:https://www.cnblogs.com/ypppt/p/13229542.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!