当前位置: 首页 > news >正文

CSS 各种形状

制作圆形:

要使用CSS来制作一个圆形,我们需要一个div,被给它设置一个ID

<div id="circle"></div> 

圆形在设置CSS时要设置宽度和高度相等,然后设置border-radius属性为宽度或高度的一半即可:

#circle {

    width: 120px;

    height: 120px;

    background: #7fee1d;

    -moz-border-radius: 60px;

    -webkit-border-radius: 60px;

    border-radius: 60px;

CSS3制作各种形状图像

制作椭圆形:

椭圆形是正圆形的一个变体,同样使用一个带ID的div来制作

 

 

<div id="oval"></div>  

设置椭圆形的CSS时,高度要设置为宽度的一半,border-radius属性也要做相应的改变:

#oval {

    width: 200px;

    height: 100px;

    background: #e9337c;

    -webkit-border-radius: 100px / 50px;

    -moz-border-radius: 100px / 50px;

    border-radius: 100px / 50px;

CSS3制作各种形状图像

制作三角形:

要创建一个CSS三角形,需要使用border,通过设置不同边的透明效果,我们可以制作出三角形的现状。另外,在制作三角形时,宽度和高度要设置为0。

 

 

 

 

 

<div id="triangle"></div>  

                           

 

 

 

 

 

 

 

 

#triangle {

    width: 0;

    height: 0;

    border-bottom: 140px solid #fcf921;

    border-left: 70px solid transparent;

    border-right: 70px solid transparent;

}   

 

 

 

 

CSS3制作各种形状图像

制作倒三角形:

与正三角形不同的是,倒三角形要设置的是border-top、border-left和border-right三条边的属性:

#triangle {

    width: 0;

    height: 0;

    border-top: 140px solid #20a3bf;

    border-left: 70px solid transparent;

    border-right: 70px solid transparent;

 

  1. 制作左三角形:
  2. 左三角形操作的是border-top、border-left和border-right三条边的属性,其中上边和下边要设置透明属性。
  3. #triangle_left {
  4.     width: 0;
  5.     height: 0;
  6.     border-top: 70px solid transparent;
  7.     border-right: 140px solid #6bbf20;
  8.     border-bottom: 70px solid transparent;
  9. }  
  10. 6

    制作菱形

    制作菱形的方法有很多种。这里使用的是transform属性和rotate相结合,使两个正反三角形上下显示。

    #diamond {

        width: 120px;

        height: 120px;

        background: #1eff00;

    /* Rotate */

        -webkit-transform: rotate(-45deg);

        -moz-transform: rotate(-45deg);

        -ms-transform: rotate(-45deg);

        -o-transform: rotate(-45deg);

        transform: rotate(-45deg);

    /* Rotate Origin */

        -webkit-transform-origin: 0 100%;

        -moz-transform-origin: 0 100%;

        -ms-transform-origin: 0 100%;

        -o-transform-origin: 0 100%;

        transform-origin: 0 100%;

        margin: 60px 0 10px 310px;

    CSS3制作各种形状图像步骤阅读
  11. 7

    制作梯形:

    梯形是三角形的一个变体,设置CSS梯形时,左右两条边设置为相等,并且给它设置一个宽度。

    #trapezium {

        height: 0;

        width: 120px;

        border-bottom: 120px solid #ec3504;

        border-left: 60px solid transparent;

        border-right: 60px solid transparent;

  12. 8

    制作平行四边形:

    平行四边形的制作方式是使用transform属性使长方形倾斜一个角度。

    #parallelogram {

        width: 160px;

        height: 100px;

        background: #8734f7;

        -webkit-transform: skew(30deg);

        -moz-transform: skew(30deg);

        -o-transform: skew(30deg);

        transform: skew(30deg);

    }  

    CSS3制作各种形状图像步骤阅读
  13. 9

    星形:

    星形的HTML结构同样使用一个带ID的空div。星形的实现方式比较复杂,主要是使用transform属性来旋转不同的边。仔细体会下面的代码。

     

     

     

     

     

    #star {

        width: 0;

        height: 0;

        margin: 50px 0;

        color: #fc2e5a;

        position: relative;

        display: block;

        border-right: 100px solid transparent;

        border-bottom: 70px solid #fc2e5a;

        border-left: 100px solid transparent;

        -moz-transform: rotate(35deg);

        -webkit-transform: rotate(35deg);

        -ms-transform: rotate(35deg);

        -o-transform: rotate(35deg);

    }

      

    #star:before {

        height: 0;

        width: 0;

        position: absolute;

        display: block;

        top: -45px;

        left: -65px;

        border-bottom: 80px solid #fc2e5a;

        border-left: 30px solid transparent;

        border-right: 30px solid transparent;

        content: '';

        -webkit-transform: rotate(-35deg);

        -moz-transform: rotate(-35deg);

        -ms-transform: rotate(-35deg);

        -o-transform: rotate(-35deg);

    }

      

    #star:after {

        content: '';

        width: 0;

        height: 0;

        position: absolute;

        display: block;

        top: 3px;

        left: -105px;

        color: #fc2e5a;

        border-right: 100px solid transparent;

        border-bottom: 70px solid #fc2e5a;

        border-left: 100px solid transparent;

        -webkit-transform: rotate(-70deg);

        -moz-transform: rotate(-70deg);

        -ms-transform: rotate(-70deg);

        -o-transform: rotate(-70deg);

    }                              

     

     

     

     

  14. 10

    六角星形:

    和五角星的制作方法不同,六角星形状的制作方法是操纵border属性来制作两半图形,然后合并它们。

     

     

     

     

     

    #star_six_points {

        width: 0;

        height: 0;

        display: block;

        position: absolute;

        border-left: 50px solid transparent;

        border-right: 50px solid transparent;

        border-bottom: 100px solid #de34f7;

        margin: 10px auto;

    }

      

    #star_six_points:after {

        content: "";

        width: 0;

        height: 0;

        position: absolute;

        border-left: 50px solid transparent;

        border-right: 50px solid transparent;

        border-top: 100px solid #de34f7;

        margin: 30px 0 0 -50px;

    }                             

     

     

     

     

     

     

    CSS3制作各种形状图像步骤阅读
  15. 11

     六边形:

    六边形的制作方法可以有很多种,可以像五边形一样,先制作一个长方形,然后在它的上面和下面各放置一个三角形。

    #hexagon {

        width: 100px;

        height: 55px;

        background: #fc5e5e;

        position: relative;

        margin: 10px auto;

    }

      

    #hexagon:before {

        content: "";

        width: 0;

        height: 0;

        position: absolute;

        top: -25px;

        left: 0;

        border-left: 50px solid transparent;

        border-right: 50px solid transparent;

        border-bottom: 25px solid #fc5e5e;

    }

      

    #hexagon:after {

        content: "";

        width: 0;

        height: 0;

        position: absolute;

        bottom: -25px;

        left: 0;

        border-left: 50px solid transparent;

        border-right: 50px solid transparent;

        border-top: 25px solid #fc5e5e;

    }                              

    CSS3制作各种形状图像步骤阅读
  16. 12

    心形:

    心形的制作是非常复杂的,可以使用伪元素来制作,分别将伪元素旋转不同的角度,并修改transform-origin属性来元素的旋转中心点。

    #heart {

        position: relative;

    }

      

    #heart:before,#heart:after {

        content: "";

        width: 70px;

        height: 115px;

        position: absolute;

        background: red;

        left: 70px;

        top: 0;

        -webkit-border-radius: 50px 50px 0 0;

        -moz-border-radius: 50px 50px 0 0;

        border-radius: 50px 50px 0 0;

        -webkit-transform: rotate(-45deg);

        -moz-transform: rotate(-45deg);

        -ms-transform: rotate(-45deg);

        -o-transform: rotate(-45deg);

        transform: rotate(-45deg);

        -webkit-transform-origin: 0 100%;

        -moz-transform-origin: 0 100%;

        -ms-transform-origin: 0 100%;

        -o-transform-origin: 0 100%;

        transform-origin: 0 100%;

    }

      

    #heart:after {

        left: 0;

        -webkit-transform: rotate(45deg);

        -moz-transform: rotate(45deg);

        -ms-transform: rotate(45deg);

        -o-transform: rotate(45deg);

        transform: rotate(45deg);

        -webkit-transform-origin: 100% 100%;

        -moz-transform-origin: 100% 100%;

        -ms-transform-origin: 100% 100%;

        -o-transform-origin: 100% 100%;

        transform-origin: 100% 100%;

    }                              

    CSS3制作各种形状图像步骤阅读
  17. 13

    蛋形:

    蛋形时椭圆形的一个变体,它的高度要比宽度稍大,并且设置正确的border-radius属性即可以制作出一个蛋形。

     

     

     

     

    #egg {

        width: 136px;

        height: 190px;

        background: #ffc000;

        display: block;

        -webkit-border-radius: 63px 63px 63px 63px / 108px 108px 72px 72px;

        border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;

    }   

     

     

     

     

    CSS3制作各种形状图像步骤阅读
  18. 14

    无穷符号:

    无穷符号可以通过border属性和设置伪元素的角度来实现。

    #infinity {

        width: 220px;

        height: 100px;

        position: relative;

    }

      

    #infinity:before,#infinity:after {

        content: "";

        width: 60px;

        height: 60px;

        position: absolute;

        top: 0;

        left: 0;

        border: 20px solid #06c999;

        -moz-border-radius: 50px 50px 0;

        border-radius: 50px 50px 0 50px;

        -webkit-transform: rotate(-45deg);

        -moz-transform: rotate(-45deg);

        -ms-transform: rotate(-45deg);

        -o-transform: rotate(-45deg);

        transform: rotate(-45deg);

    }

      

    #infinity:after {

        left: auto;

        right: 0;

        -moz-border-radius: 50px 50px 50px 0;

        border-radius: 50px 50px 50px 0;

        -webkit-transform: rotate(45deg);

        -moz-transform: rotate(45deg);

        -ms-transform: rotate(45deg);

        -o-transform: rotate(45deg);

        transform: rotate(45deg);

    }                              

    CSS3制作各种形状图像步骤阅读
    1. 15
    2. 消息提示框:
    3. 消息提示框可以先制作一个圆角矩形,然后在需要的地方放置一个三角形。
    4. #comment_bubble {
    5.     width: 140px;
    6.     height: 100px;
    7.     background: #088cb7;
    8.     position: relative;
    9.     -moz-border-radius: 12px;
    10.     -webkit-border-radius: 12px;
    11.     border-radius: 12px;
    12. }
    13.   
    14. #comment_bubble:before {
    15.     content: "";
    16.     width: 0;
    17.     height: 0;
    18.     right: 100%;
    19.     top: 38px;
    20.     position: absolute;
    21.     border-top: 13px solid transparent;
    22.     border-right: 26px solid #088cb7;
    23.     border-bottom: 13px solid transparent;
    24. }                              
    CSS3制作各种形状图像

 

--------------------------------------------------------------------------------------------------------------------------------------------

****************************************************************************************************

border-bottom:24px solid #F00;
border-right:24px solid transparent;
border-top:24px solid #F00;
border-left:24px solid transparent;

以前以为border是个中规中矩的长方形,我们可以看出来其实border的图片并不是中规中矩的长方形.而是梯形的结构

利用这一原理就可以制作出斜方向的不规则图片如

代码如下:
border-bottom:24px solid #F00;
border-right:24px solid transparent;(宽度存在但是为透明)

 
理解css结构,border设置宽度就意味着自身的高度要设置为0,才能保证他在同一行中。

 

如图未设置高度为0时

设置height:0时

大家也可以自己尝试一下,

借此也可以更好的理解css3.0中的伪类after,before来构造不规则的图片!避免使用了较大的图片。

*****************************************************************************************************

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
body{ background: #161616;}
.frame{ width: 100%; min-width: 420px;}
.frame li{ float:left; width: 100px; height: 100px;  margin: 1px; background: #1c1c1c; list-style: none; padding: 50px;}
.square{ width: 100px; height: 100px; background: #fff;}
.square-round-one{ width: 100px; height: 100px; background: #fff; -webkit-border-top-left-radius: 50%; border-top-left-radius: 50%;}
.square-round-two{ width: 100px; height: 100px; background:#fff; -webkit-border-radius: 50% 0 50% 0;border-radius: 50% 0 50% 0;}
.square-round-three{ width: 100px; height: 100px; background:#fff; -webkit-border-radius: 50% 0 50% 50%;border-radius: 50% 0 50% 50%;}
.square-round-half{ width: 100px; height: 100px; background: #fff; -webkit-border-radius: 0 50% 50% 0;border-radius: 0 50% 50% 0;}
.circle{ width: 100px; height: 100px; background: #fff; -webkit-border-radius: 50%; border-radius:50%;}
.diamond{ width: 100px; height: 100px; background:#fff; -webkit-transform: rotate(45deg); transform: rotate(45deg); -webkit-border-radius: 5%;border-radius: 5%;}
.diamond-cut{border-color:transparent transparent #fff transparent; border-width:0 25px 25px 25px; border-style: solid; position: relative;}
.diamond-cut::after{content: "";border-color:#fff transparent transparent transparent;border-style: solid;border-width:75px 50px 0 50px ;position: absolute; top: 25px; left: -25px;}
.rhombus{ border-color:transparent transparent #fff  transparent; border-style: solid; border-width:50px; border-bottom-width:70px; border-top-width: 0; position: relative; top:-30px;}
.rhombus::after{ content: ""; border-color:#fff transparent transparent transparent; border-style: solid; border-width:50px; border-top-width:70px; border-bottom-width:0; position: absolute;top:70px; left:-50px;}
.trapezoid{ width: 100px; margin-left:-35px ; border-bottom: 70px solid #fff; border-left: 35px solid transparent; border-right: 35px solid transparent;}
.pentagon{ width: 70px; position:relative; top:40px; left:0px;border-top: 50px solid #fff; border-left: 18px solid transparent; border-right:18px solid transparent;}
.pentagon::after{ content: ""; border-color: transparent transparent #fff; border-style: solid;  border-width: 0 55px 50px;  position: absolute; top:-100px; left:-20px;}
.hexagon{ width: 100px; height: 50px; background: #fff; position: relative; margin-top: 25px;}
.hexagon::before{  content: ""; border-color: transparent transparent #fff; border-style: solid; border-width: 0 50px 35px; position: absolute; top:-35px;  }
.hexagon::after{ content: ""; border-color: #fff transparent transparent; border-style: solid; border-width:35px 50px 0; position: absolute; top:50px;} 
.octagon{ width: 100px; height: 50px; background: #fff; position: relative; margin-top: 25px;}		
.octagon::before{content: ""; height:0px; width:50px; position:absolute; margin-top: -25px; border-bottom: 25px solid #fff;border-left:25px solid #1c1c1c; border-right:25px solid #1c1c1c; }	
.octagon::after{ content:""; height: 0; width: 50px; position: absolute; margin-top: 50px; border-top: 25px solid #fff; border-left: 25px solid #1c1c1c; border-right: 25px solid #1c1c1c;}
.rectangle{ width: 100px; height: 50px; margin-top: 20px; background:#fff;}
.parallelogram-left{ width: 100px; height: 50px; margin-top: 20px; background:#fff; -webkit-transform: skew(20deg); transform: skew(20deg);}
.parallelogram-right{ width: 100px; height: 50px; margin-top: 20px; background: #fff; -webkit-transform: skew(-20deg); transform: skew(-20deg);}
.heart{ width: 100px; height: 100px; position: relative; margin-left: -10px;}
.heart::before,.heart::after{ content: ""; width: 60px; height: 100px; background:#ff6666; position: absolute; top:0; left:60px; border-radius: 50px 50px 0 0;-webkit-transform: rotate(-45deg); transform: rotate(-45deg); -webkit-transform-origin: 0 100%; transform-origin: 0 100%;}
.heart::after{ position:absolute; left:20px; top:-40px;-webkit-transform: rotate(45deg); transform: rotate(45deg); -webkit-transform-origin: 0 100%; transform-origin: 0 100%; }
.triangle{ width: 0; border-color: transparent transparent #fff; border-style: solid; border-width: 0 50px 100px; }
.triangle-down{ width: 0; border-color: #fff transparent transparent; border-style: solid; border-width: 100px 50px 0;}
.triangle-left{ width: 0; border-color: transparent #fff transparent transparent ; border-style: solid; border-width: 50px 100px 50px 0;}
.triangle-right{ width: 0; border-color: transparent transparent transparent #fff; border-style: solid; border-width: 50px 0 50px 100px;}
.triangle-left-top{ width: 0; border-color: #fff transparent transparent #fff; border-style: solid; border-width: 50px; }
.triangle-right-top{ width: 0; border-color:#fff #fff transparent transparent; border-style: solid; border-width:50px;}
.triangle-left-bottom{ border-color: transparent transparent #fff #fff; border-style: solid; border-width: 50px;}
.triangle-right-bottom{ border-color: transparent #fff #fff transparent; border-style: solid; border-width: 50px;}
.arrow-up{ width: 0; border-color: transparent transparent #fff; border-style: solid; border-width: 0 45px 50px; position: relative; margin-top: -5px; margin-left: 10px;}
.arrow-up::after{ content: ""; width: 35px; height: 70px; background: #fff; position: absolute; top: 30px; left: -18px;}
.arrow-down{ width: 0; border-color: #fff transparent transparent; border-style: solid; border-width: 50px; position: relative; top:50px;}
.arrow-down::after{ content: ""; width: 35px; height: 70px; background: #fff; position: absolute; bottom:25px; left:-18px;}
.arrow-left{ width: 0; border-color: transparent #fff transparent transparent; border-style: solid; border-width: 50px; position: relative;right:60px;} 
.arrow-left::after{ content: ""; width: 75px; height:35px; background: #fff; position: absolute; top: -17px; left: 25px;}
.arrow-right{ width: 0; border-color: transparent transparent transparent #fff; border-style: solid; border-width: 50px; position: relative; left: 60px;}
.arrow-right::after{ content: ""; width: 75px; height: 35px; background:#fff; position: absolute; top: -17px; right:25px ;}
.circle-spin-half{ width: 60px; height: 60px; background: transparent; border-color: transparent transparent #fff #fff; border-style: solid; border-width: 20px; border-radius: 50%; -webkit-animation:circle-spin-half 1.2s linear infinite; animation:circle-spin-half 1.2s linear infinite;}
@-webkit-keyframes circle-spin-half{
	0%{-webkit-transform: rotate(0deg);} 
	100%{-webkit-transform: rotate(360deg);}
}
@keyframes circle-spin-half{
	0%{transform: rotate(0deg);} 
	100%{transform: rotate(360deg);}
}
.oval{ width: 100px; height:50px; border-radius: 50%; background:#fff; margin-top: 20px;}
.circle-half-top{  width:100px; height:50px; background:#fff; border-radius: 100px 100px 0 0;}
.circle-half-bottom{ width: 100px; height: 50px; background: #fff; border-radius: 0 0 100px 100px; margin-top: 50px;}
.circle-half-left{ width: 50px; height: 100px; background: #fff; border-radius: 100px 0 0 100px;}
.circle-half-right{ width: 50px; height: 100px; background: #fff; border-radius: 0 100px 100px 0; margin-left: 50px;}
.circle-left-top{ width: 100px; height: 100px; background:#fff; border-top-left-radius:100%;}
.circle-right-top{ width: 100px; height: 100px; background: #fff; border-top-right-radius: 100%;}
.circle-left-bottom{ width: 100px; height: 100px; background: #fff; border-bottom-left-radius: 100%;}
.circle-right-bottom{ width: 100px; height: 100px; background: #fff; border-bottom-right-radius: 100%;}
.circle-quarter-left-top{  border-color: #fff transparent transparent transparent; border-style: solid; border-width: 100px; border-radius: 100%; margin-left:-50px;}
.circle-quarter-right-top{ border-color: transparent #fff transparent transparent; border-style: solid; border-width: 100px;  border-radius: 100%; margin-left: -100px; margin-top: -50px;}
.circle-quarter-bottom{ border-color: transparent transparent #fff; border-style: solid; border-width:0 100px 100px; border-radius: 100%; margin-left: -50px;}
.circle-quarter-left{ border-color:transparent transparent transparent #fff; border-style: solid; border-width: 80px 0 80px 100px; border-radius: 100%; margin-top: -35px;}
.circle-wedge-top{border-color: transparent #fff #fff; border-style: solid; border-width: 50px; border-radius: 100%;}
.circle-wedge-right{ border-color: #fff transparent #fff #fff; border-style: solid; border-width: 50px; border-radius: 100%;}
.circle-wedge-bottom{ border-color: #fff #fff transparent #fff; border-style: solid; border-width: 50px; border-radius: 100%;}
.circle-wedge-left{ border-color: #fff #fff #fff transparent; border-style: solid; border-width: 50px; border-radius: 100%;}
.flower{ width: 100px; height: 100px; background: #fff; border-radius:20%;}
.flower::before{ content: ""; width: 100px; height: 100px; background: #fff; border-radius: 20%; position: absolute; -webkit-transform: rotate(45deg); transform: rotate(45deg);}
/*用定位是把添加的元素转化成块级元素,也可以使用display:block;*/
.star-six{ width: 0; border-color: transparent transparent #fff; border-style: solid; border-width:0 50px 80px; position: relative;}
.star-six::after{ content: ""; border-color:#fff transparent transparent; border-style: solid; border-width: 80px 50px 0; position: absolute; left: -50px; top: 25px;}
.star-eight{border-color: #fff transparent #fff transparent; border-style: solid; border-width: 20px; margin-top: 30px; position: relative;}
.star-eight::after{ content: ""; border-color:transparent #fff transparent #fff;border-style: solid; border-width: 20px; position: absolute; height: 60px; top:-50px; left: 10px; }
.star-twelve{ width: 100px; height: 100px; background: #fff; position: relative;}
.star-twelve::before,.star-twelve::after{ content:"";width: 100px; height: 100px; background: #fff; position: absolute; -webkit-transform: rotate(30deg); transform: rotate(30deg);}
.star-twelve::after{ -webkit-transform: rotate(-30deg);transform: rotate(-30deg);}
.cross{ width: 35px; height: 100px; background: #fff; position: relative; margin-left: 30px; -webkit-transform: rotate(45deg); transform: rotate(45deg); }
.cross::after{ content: ""; width: 35px; height: 100px; background: #fff; position: absolute; -webkit-transform: rotate(-90deg); transform: rotate(-90deg);}
.cross-round{background: #ffffff;width: 33px;height: 100px;position: relative;margin-left: 33px;border-radius: 20px;-webkit-transform: rotate(45deg);transform: rotate(45deg);}
.cross-round:before {background: #ffffff;content: "";width: 100px;height: 33px;position: absolute;top: 33px;left: -33px;border-radius: 20px;}
/*两个cross cross-round 两个方式不同,宽高是相反的*/
.plus{ width: 33px; height: 100px; background: #fff; position: relative; left: 33px;}
.plus::after{ content: ""; width: 100px; height: 33px; background: #fff; position: absolute; top: 33px; left: -33px;}
.plus-round{ width: 33px; height: 100px; background: #fff; border-radius: 20px; margin-left: 33px; position: relative;}
.plus-round::after{ content: ""; width: 100px; height: 33px; background: #fff; border-radius: 20px; position: absolute; left: -33px; top:33px;}
.search{ width: 35px; height: 35px; border-radius: 50%;border:8px solid #fff; position:relative; margin-left: 20px; margin-top: 20px;}
.search::after{ width:10px; height:30px; content: ""; background: #fff; position: absolute;top:25px; left: 40px; -webkit-transform: rotate(-45deg); transform: rotate(-45deg);}
.map-pin{ width: 30px; height:30px; border:15px solid #fff; border-radius: 50%; margin-left:20px; margin-top: 10px; position: relative;}
.map-pin::after{ content: "";border-color:#fff transparent transparent; border-style: solid; border-width:35px 25px 0; position: absolute; top:32px; left: -10px;}
.callout{ width: 100px; height:50px;background: #fff; border-radius: 10px; position: relative; margin-top:20px;}
.callout::after{ content: ""; border-color: transparent #fff transparent transparent; border-style: solid; border-width:10px 15px 10px 0; position: absolute; left:-15px; top:15px;}
.yinyang{ width: 96px; height: 48px; border: 2px solid #fff; border-radius: 50%; background: #000; border-width: 2px 2px 50px 2px; position: relative;-webkit-animation: circle-spin-half 1.2s linear infinite; animation: circle-spin-half 1.2s linear infinite;}
.yinyang::before{ content: ""; position: absolute; width: 12px; height: 12px; background: #000;  border-radius: 50%; top:50%;left:0; border: 18px solid #fff;}
.yinyang::after{ content: ""; position: absolute; width: 12px; height: 12px; background: #fff; border-radius: 50%;border:18px solid #000; left:50%; top: 50%; }
.iphone{ width:40px; height: 60px; border-width: 15px 5px; border-color:#fff; border-style: solid; border-radius: 5px; position: relative; margin-left: 20px; margin-top:10px;}
.iphone::before{ content: ""; position: absolute; width: 15px; height: 5px; background: #000; top:-10px; left:13px;}
.iphone::after{ content: ""; position: absolute; width: 10px; height: 10px; border-radius: 50%; background: #000; bottom:-13px;left: 14px;}
.bookmark{width: 0; height: 70px; border-left: 25px solid #fff; border-right: 25px solid #fff; border-bottom: 25px solid transparent; margin-left: 25px;}
.battery{ width:50px; height: 30px; background: #fff; position: relative; margin-top: 20px;}
.battery::after{ content: ""; position: absolute; top:-15px; left:-15px; width: 80px; height: 50px; border: 5px solid #fff; border-radius: 5px;}
.battery::before{ content: ""; position: absolute; width: 10px; height: 15px; border: 5px solid #fff; border-radius: 5px; right:-40px; top:5px;}
.eye{ width: 70px; height: 70px; position: relative; background: #fff; border-radius: 50% 0 50% 0; -webkit-transform: rotate(45deg); transform: rotate(45deg);}
.eye::after{ content: ""; position: absolute; width: 20px; height: 20px; background: #fff; border-radius: 50%; border:10px solid #000; top:15px; left: 15px;}
</style>
</head>
<body>

<div class="frame">
	<ul>
		<li><div class="square"></div></li>
		<li><div class="square-round-one"></div></li>
		<li><div class="square-round-two"></div></li>
		<li><div class="square-round-three"></div></li>
		<li><div class="square-round-half"></div></li>
		<li><div class="circle"></div></li>
		<li><div class="diamond"></div></li>
		<li><div class="diamond-cut"></div></li>
		<li><div class="rhombus"></div></li>
		<li><div class="trapezoid"></div></li>
		<li><div class="pentagon"></div></li>
		<li><div class="hexagon"></div></li>
		<li><div class="octagon"></div></li>
		<li><div class="rectangle"></div></li>
		<li><div class="parallelogram-left"></div></li>
		<li><div class="parallelogram-right"></div></li>
		<li><div class="heart"></div></li>
		<li><div class="triangle"></div></li>
		<li><div class="triangle-down"></div></li>
		<li><div class="triangle-left"></div></li>
		<li><div class="triangle-right"></div></li>
		<li><div class="triangle-left-top"></div></li>
		<li><div class="triangle-right-top"></div></li>
		<li><div class="triangle-left-bottom"></div></li>
		<li><div class="triangle-right-bottom"></div></li>
		<li><div class="arrow-up"></div></li>	
		<li><div class="arrow-down"></div></li>
		<li><div class="arrow-left"></div></li>
		<li><div class="arrow-right"></div></li>
		<li><div class="circle-spin-half"></div></li>
		<li><div class="oval"></div></li>
		<li><div class="circle-half-top"></div></li>
		<li><div class="circle-half-bottom"></div></li>
		<li><div class="circle-half-left"></div></li>
		<li><div class="circle-half-right"></div></li>
		<li><div class="circle-left-top"></div></li>
		<li><div class="circle-right-top"></div></li>
		<li><div class="circle-left-bottom"></div></li>
		<li><div class="circle-right-bottom"></div></li>
		<li><div class="circle-quarter-left-top"></div></li>
		<li><div class="circle-quarter-right-top"></div></li>
		<li><div class="circle-quarter-bottom"></div></li>
		<li><div class="circle-quarter-left"></div></li>
		<li><div class="circle-wedge-top"></div></li>
		<li><div class="circle-wedge-right"></div></li>
		<li><div class="circle-wedge-bottom"></div></li>
		<li><div class="circle-wedge-left"></div></li>
		<li><div class="flower"></div></li>
		<li><div class="star-six"></div></li>
		<li><div class="star-eight"></div></li>
		<li><div class="star-twelve"></div></li>
		<li><div class="cross"></div></li>
		<li><div class="cross-round"></div></li>
		<li><div class="plus"></div></li>
		<li><div class="plus-round"></div></li>
		<li><div class="search"></div></li>
		<li><div class="map-pin"></div></li>
		<li><div class="callout"></div></li>
		<li><div class="yinyang"></div></li>
		<li><div class="iphone"></div></li>
		<li><div class="bookmark"></div></li>
		<li><div class="battery"></div></li>
		<li><div class="eye"></div></li>
	</ul>
	<div style="clear: both;"></div>
</div>	

	
</body>
</html>

  

 

 

转载于:https://www.cnblogs.com/xiangxiong/p/7009062.html

相关文章:

  • 用php 生成 excel 表格
  • .Net 路由处理厉害了
  • mybatis中批量插入以及更新
  • robots.txt的语法和写法详解
  • STL 标准模板库
  • Servlet 详解
  • I/O流
  • 菜鸟学习Redis(二)——Redis集群
  • 行为模式--代理Proxy模式(Java)
  • python 类的特殊成员
  • 修改敏感字
  • Java内部类
  • $.ajax中的eval及dataType
  • https 安全验证问题
  • 平安科技移动开发二队技术周报(第八期)
  • [rust! #004] [译] Rust 的内置 Traits, 使用场景, 方式, 和原因
  • CSS中外联样式表代表的含义
  • passportjs 源码分析
  • springboot_database项目介绍
  • 记一次用 NodeJs 实现模拟登录的思路
  • 近期前端发展计划
  • 聊聊springcloud的EurekaClientAutoConfiguration
  • 前端工程化(Gulp、Webpack)-webpack
  • 前端设计模式
  • 浅谈web中前端模板引擎的使用
  • 微信小程序--------语音识别(前端自己也能玩)
  • 小程序button引导用户授权
  • 责任链模式的两种实现
  • 正则与JS中的正则
  • Spring Batch JSON 支持
  • ​520就是要宠粉,你的心头书我买单
  • # Maven错误Error executing Maven
  • #pragma multi_compile #pragma shader_feature
  • #Spring-boot高级
  • #每天一道面试题# 什么是MySQL的回表查询
  • (20)目标检测算法之YOLOv5计算预选框、详解anchor计算
  • (八)五种元启发算法(DBO、LO、SWO、COA、LSO、KOA、GRO)求解无人机路径规划MATLAB
  • (二十四)Flask之flask-session组件
  • (附源码)python房屋租赁管理系统 毕业设计 745613
  • (免费领源码)python+django+mysql线上兼职平台系统83320-计算机毕业设计项目选题推荐
  • (欧拉)openEuler系统添加网卡文件配置流程、(欧拉)openEuler系统手动配置ipv6地址流程、(欧拉)openEuler系统网络管理说明
  • (原)Matlab的svmtrain和svmclassify
  • (最完美)小米手机6X的Usb调试模式在哪里打开的流程
  • ******IT公司面试题汇总+优秀技术博客汇总
  • .gitattributes 文件
  • .java 9 找不到符号_java找不到符号
  • .net core开源商城系统源码,支持可视化布局小程序
  • .Net Framework 4.x 程序到底运行在哪个 CLR 版本之上
  • .net framework profiles /.net framework 配置
  • .NET运行机制
  • ::before和::after 常见的用法
  • [ SNOI 2013 ] Quare
  • [383] 赎金信 js
  • [AIGC] 开源流程引擎哪个好,如何选型?
  • [Android]How to use FFmpeg to decode Android f...