您的位置:首页 > Web前端 > CSS

css两种让div背景透明文案不透明的方式(opacity、rgba)

2016-10-24 10:40 495 查看
<!DOCTYPE html>

<html>
<head>
<meta charset="utf-8" />
<title></title>
<style>
.d1
{
/*opacity:0.3;*/
background-color: rgba(36,61,89,0.5);
width:500px;   
height:500px;color:#F30; 

}

.d2
{
position: fixed;
top: 0px;
font-size:32px; 
font-weight:bold; 
border: 1px yellow solid;
}
</style>
</head>
<body>

<div class="d1">
<p>不透明</p>
</div> 
<!--<div class="d2"><p>不透明</p></div>-->
</body>

</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: