奥运五环

 <!DOCTYPE html> 
2 <html>
3 <head>
4 <meta charset="UTF-8" />
5 <title>The Olympic Flag</title>
6 <style type="text/css" media="screen">
7 body {
8 margin:20px;
9 background-color:#efefef;
10 }
11 ul.flag {
12 list-style-type:none;
13 position: relative;
14 margin: 20px auto;
15 }
16
17 .flag li, .flag li:before, .flag li:after {
18 -webkit-border-radius: 6em;
19 -moz-border-radius: 6em;
20 border-radius: 6em;
21 position: absolute;
22 }
23
24 .flag li {
25 width: 12em;
26 height: 12em;
27 left: 0;
28 top: 0;
29 font-size: 1em;
30 }
31
32 .flag li:after {
33 display: block;
34 content: "";
35 top: -0.1em;
36 left: -0.1em;
37 right: -0.1em;
38 bottom: -0.1em;
39 border: solid 1.4em black;
40 }
41
42 .flag .blue { z-index: 10; left: 0; top: 0; }
43 .flag .yellow { z-index: 20; left: 6.8em; top: 5.7em; }
44 .flag .black { z-index: 21; left: 13.6em; top: 0; }
45 .flag .green { z-index: 20; left: 20.4em; top: 5.7em; }
46 .flag .red { z-index: 10; left: 27.2em; top: 0px; }
47
48 .flag .blue:after { border-color: blue; }
49 .flag .yellow:after { border-color: yellow; }
50 .flag .black:after { border-color: black; }
51 .flag .green:after { border-color: green; }
52 .flag .red:after { border-color: red; }
53 /* 蓝色压住黄色 */
54 .flag .blue.alt { z-index: 24; }
55 .flag .blue.alt,
56 .flag .blue.alt:before,
57 .flag .blue.alt:after {
58 border-top-color: transparent;
59 border-left-color: transparent;
60 border-bottom-color: transparent;
61 }
62 /* 黄色压住黑色 */
63 .flag .yellow.alt { z-index: 23; }
64 .flag .yellow.alt,
65 .flag .yellow.alt:before,
66 .flag .yellow.alt:after {
67 border-right-color: transparent;
68 border-left-color: transparent;
69 border-bottom-color: transparent;
70 }
71 /* 绿色压住黑色 */
72 .flag .green.alt { z-index: 23; }
73 .flag .green.alt,
74 .flag .green.alt:before,
75 .flag .green.alt:after {
76 border-top-color: transparent;
77 border-right-color: transparent;
78 border-bottom-color: transparent;
79 }
80 /* 红色压住绿色 */
81 .flag .red.alt { z-index: 23; }
82 .flag .red.alt,
83 .flag .red.alt:before,
84 .flag .red.alt:after {
85 border-top-color: transparent;
86 border-right-color: transparent;
87 border-left-color: transparent;
88 }
89 </style>
90 </head>
91 <body>
92 <ul class="flag">
93 <li class="blue"></li>
94 <li class="blue alt"></li>
95 <li class="yellow"></li>
96 <li class="yellow alt"></li>
97 <li class="black"></li>
98 <li class="green"></li>
99 <li class="green alt"></li>
100 <li class="red"></li>
101 <li class="red alt"></li>
102 </ul>
103 </body>
104 </html>   
posted @ 2015-05-26 10:52  brady-wang  阅读(331)  评论(0编辑  收藏  举报