-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCSS3Demo2.html
164 lines (159 loc) · 3.37 KB
/
CSS3Demo2.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>CSS3实现基本图形: Demo2</title>
<style>
#TV {
float: left;
position: relative;
width: 160px;
height: 120px;
margin: 10px 20px;
background: black;
border-radius: 50% / 10%;
color: white;
text-align: center;
text-indent: .1em;
}
#TV:before {
content: '';
position: absolute;
top: 10%;
bottom: 10%;
right: -5%;
left: -5%;
background: inherit;
border-radius: 5% / 50%;
}
#Chevron {
float: left;
margin: 16px 5px;
position: relative;
text-align: center;
padding: 12px;
margin-bottom: 6px;
height: 60px;
width: 200px;
}
#Chevron:before {
content: '';
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 51%;
background: red;
-webkit-transform: skew(0deg, 6deg);
-moz-transform: skew(0deg, 6deg);
-ms-transform: skew(0deg, 6deg);
-o-transform: skew(0deg, 6deg);
transform: skew(0deg, 6deg);
}
#Chevron:after {
content: '';
position: absolute;
top: 0;
right: 0;
height: 100%;
width: 50%;
background: red;
-webkit-transform: skew(0deg, -6deg);
-moz-transform: skew(0deg, -6deg);
-ms-transform: skew(0deg, -6deg);
-o-transform: skew(0deg, -6deg);
transform: skew(0deg, -6deg);
}
#MagnifyingGlass{
float: left;
font-size: 10em; /* This controls the size. */
margin: 10px 10px;
display: inline-block;
width: 0.4em;
height: 0.4em;
border: 0.1em solid green;
position: relative;
border-radius: 0.35em;
}
#MagnifyingGlass:before{
content: "";
display: inline-block;
position: absolute;
right: -0.25em;
bottom: -0.1em;
border-width: 0;
background: green;
width: 0.35em;
height: 0.08em;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
}
#FacebookIcon {
float: left;
margin: 16px 16px;
background: blue;
text-indent: -999em;
width: 100px;
height: 110px;
border-radius: 5px;
position: relative;
overflow: hidden;
border: 15px solid blue;
border-bottom: 0;
}
#FacebookIcon::before {
content: "/20";
position: absolute;
background: blue;
width: 40px;
height: 90px;
bottom: -30px;
right: -37px;
border: 20px solid #eee;
border-radius: 25px;
}
#FacebookIcon::after {
content: "/20";
position: absolute;
width: 55px;
top: 50px;
height: 20px;
background: #eee;
right: 5px;
}
#Cross {
float: left;
margin: 10px 30px;
background: red;
height: 100px;
position: relative;
width: 20px;
}
#Cross:after {
background: red;
content: "";
height: 20px;
left: -40px;
position: absolute;
top: 40px;
width: 100px;
}
</style>
</head>
<body>
<!-- 电视屏幕(TV Screen) -->
<div id="TV"></div>
<!-- 雪佛龙(Chevron) -->
<div id="Chevron"></div>
<!-- 放大镜(Magnifying Glass) -->
<div id="MagnifyingGlass"></div>
<!-- Facebook图标(Facebook Icon) -->
<div id="FacebookIcon"></div>
<!-- 十字架(Cross) -->
<div id="Cross"></div>
<!-- 浮动Div换行 -->
<div style="clear:both">
</body>
</html>