-
Notifications
You must be signed in to change notification settings - Fork 0
/
opacity.html
55 lines (54 loc) · 1.28 KB
/
opacity.html
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<html>
<head>
<meta charset='utf-8'>
<title>背景透明,文字不透明</title>
<style type="text/css">
.container{
position: relative;
width: 600px;
height: 300px;
border: 1px solid #0f0;
}
.opcacity{
position: absolute;
left: 0;
top: 0;
width: 178px;
height: 143px;
background:#000;
opacity: .3;
color: #f00;
text-align: center;
}
.common{
position: absolute;
left: 0;
top: 0;
width: 178px;
height: 143px;
background:#000;
filter: alpha(opacity=0.3);
background:rgba(0, 0, 0, 0.3) none repeat scroll 0 0 !important;
color: #f00;
text-align: center;
}
</style>
</head>
<body>
<h1>opcacity</h1>
<div class="container">
背景下的文字
<div class="opcacity">
这里是文字
</div>
</div>
<h1>grb</h1>
<div class="container">
背景下的文字
<div class="common">
这里是文字
</div>
</div>
参考链接:http://www.admin10000.com/Document/31.html
</body>
</html>