forked from craic/CSS3_webkit_demos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mask_box_image_demo.html
99 lines (82 loc) · 1.5 KB
/
mask_box_image_demo.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<!DOCTYPE html>
<html>
<head>
<title>CSS3 Webkit Examples</title>
<style>
body {
background: #ddd;
}
h2 {
font-weight: normal;
text-align: center;
font-family: courier;
}
#main {
position: relative;
margin-left: auto;
margin-right: auto;
width: 600px;
height: 400px;
background: white;
color: black;
font-size: 14px;
}
#code {
position: relative;
margin-left: auto;
margin-right: auto;
width: 600px;
color: black;
font-family: courier;
font-size: 14px;
white-space: pre;
background-color: #eee;
}
#img1 {
position: absolute;
background: #eef;
width: 400px;
height: 300px;
left: 0px;
top: 0px;
text-align: center;
background-image: url('images/woodland.png') ;
}
#img2 {
position: absolute;
background: #eef;
width: 100px;
height: 100px;
left: 450px;
top: 200px;
text-align: center;
background-image: url('images/woodland.png') ;
background-position: -95px -85px;
-webkit-mask-box-image: url('images/circular_mask_100px.png');
}
#img3 {
position: absolute;
background: #eef;
width: 100px;
height: 100px;
left: 450px;
top: 0px;
text-align: center;
background-image: url('images/circular_mask_100px.png') ;
}
</style>
</head>
<body>
<h2>-webkit-mask-box-image: url(<i>'mask_image.png'</i>);</h2>
<div id='main'>
<div id='img1'></div>
<div id='img2'></div>
<div id='img3'></div>
</div>
<br/>
<div id='code'>background-image: url('images/woodland.png') ;
background-position: -95px -85px;
-webkit-mask-box-image: url('images/circular_mask_100px.png');
</div>
</body>
</html>