background-color: rgba(0, 0, 0, .5);中的0.5表示这个矩形遮罩的透明度。
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>HTML+CSS实现图片下半部分遮罩文字效果</title>
<style>
.class_outer {
display: block;
width: 550px;
height: 260px;
margin: 10px auto;
position: relative;
overflow: hidden;
}
.class_cover {
width: 100%;
height: 50px;
line-height: 50px;
padding-left: 5px;
background-color: rgba(0, 0, 0, .5);
color: #FFFFFF;
font-size: 26px;
position: absolute;
left: 0px;
bottom: 0px;
}
</style>
</head>
<body>
<a href="#" class="class_outer">
<img src="img/01.jpg" width="550px" height="276px" border="0" />
<span class="class_cover">我是文本来描述内容的。</span>
</a>
</body>
</html>
最后
以上就是坚强枕头最近收集整理的关于图片底部遮罩效果的全部内容,更多相关图片底部遮罩效果内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复