html中raba中的颜色该怎么设置?

html-css015

html中raba中的颜色该怎么设置?,第1张

使用css设置例子如下:

p{

color: rgba(0,0,0,0.5)

}

只要是有颜色单位的属性都可以设置rgba,如:background-color,border-color等

具体格式 rgba(R,G,B,A)

css代码

.fbox{ width:300pxheight:300pxbackground-color:redfilter:alpha(Opacity=50)opacity: 0.5}

.zbox{ width:100pxheight:100pxbackground-color:green}

html代码

<div class="fbox">

<div class="zbox">

我也透明了

</div>

</div>

继承是父级设置透明而子级继承,另外透明还要注意兼容。