CSS设置背景图片透明度的方法:使用opacity属性可以设置背景图片透明度。示例:<!DOCTYPE html><html> <head>&nbs
CSS设置背景图片透明度的方法:
使用opacity属性可以设置背景图片透明度。
示例:
<!DOCTYPE html><html>
<head>
<meta charset="UTF-8">
<title>背景图片设置</title>
<style>
.demo{
position:fixed;
top: 0;
left: 0;
width:100%;
height:100%;
min-width: 1000px;
z-index:-10;
zoom: 1;
background-color: #fff;
background: url(2.png);
background-repeat: no-repeat;
background-size: cover;
-WEBkit-background-size: cover;
-o-background-size: cover;
background-position: center 0;
opacity:0.5; //设置div元素的不透明级别为0.5
}
</style>
</head>
<body>
<div class="demo"></div>
</body>
</html>
--结束END--
本文标题: css怎么设置背景图片透明度
本文链接: https://www.lsjlt.com/news/112894.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-05-10
2024-05-10
2024-05-10
2024-05-10
2024-05-10
2024-05-10
2024-05-10
2024-05-10
2024-05-10
2024-05-10
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0