css3.0 图形构成实例练习一
程序员文章站
2022-07-18 16:53:26
css3.0 的出现给我们带来了很大的影响,本文主要介绍下图形构成,感兴趣的朋友可以参考并学习下实例,希望对你学习css3有所帮助... 13-03-19...
html部分内容
<div class="header">
<div class="eye_left"></div>
<div class="eye_right">
<div class="eye_in"></div>
</div>
<div class="head_bottom"></div>
</div>
css部分
*{ padding:0; margin:0;}
.header{ width:300px; margin:100px auto; position:relative; }
.eye_left,.eye_right{
width:30px;
height:30px;
background:#fff;
position:absolute;
border:70px solid #0c0;
border-radius:160px;
-moz-border-radius:160px;
-webkit-border-radius:160px;
-o-border-radius:160px;}
.eye_left{
left:10px;
top:0px;}
.eye_right{
right:0px;
top:0px;}
.head_bottom{
width:200px;
border:#0c0 solid 60px;
border-radius:160px;
-moz-border-radius:160px;
-webkit-border-radius:160px;
-o-border-radius:160px;
height:30px;
left:0px;
position:absolute;
top:120px;
z-index:-5;}
.eye_in{
background:#0c0;
height:30px;
width:30px;
position:absolute;
right:-30px;
top:-30px;
border:#fff 30px solid;
border-radius:160px;
-moz-border-radius:160px;
-webkit-border-radius:160px;
-o-border-radius:160px;}
复制代码
代码如下:<div class="header">
<div class="eye_left"></div>
<div class="eye_right">
<div class="eye_in"></div>
</div>
<div class="head_bottom"></div>
</div>
css部分
复制代码
代码如下:*{ padding:0; margin:0;}
.header{ width:300px; margin:100px auto; position:relative; }
.eye_left,.eye_right{
width:30px;
height:30px;
background:#fff;
position:absolute;
border:70px solid #0c0;
border-radius:160px;
-moz-border-radius:160px;
-webkit-border-radius:160px;
-o-border-radius:160px;}
.eye_left{
left:10px;
top:0px;}
.eye_right{
right:0px;
top:0px;}
.head_bottom{
width:200px;
border:#0c0 solid 60px;
border-radius:160px;
-moz-border-radius:160px;
-webkit-border-radius:160px;
-o-border-radius:160px;
height:30px;
left:0px;
position:absolute;
top:120px;
z-index:-5;}
.eye_in{
background:#0c0;
height:30px;
width:30px;
position:absolute;
right:-30px;
top:-30px;
border:#fff 30px solid;
border-radius:160px;
-moz-border-radius:160px;
-webkit-border-radius:160px;
-o-border-radius:160px;}
上一篇: 中小企业如何在网络营销中胜出?
下一篇: 企业在新闻源发布新闻稿多重效果分析