用css3实现thinkPHP的logo

jerry thinkphp 2015年11月18日 收藏
用css3绘制thinkPHP的logo
兼容chrome,firefox,safari等主流浏览器
  1. <!DOCTYPE html>
  2. <!-- 此版本为镜花水月根据网络资源所修改,兼容chrome,firefox,safari等主流浏览器 -->
  3. <!-- 原版代码在这里 http://www.thinkphp.cn/code/48.html -->
  4. <html>
  5.     <head>
  6.         <meta charset="utf-8">
  7.         <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  8.         <title>tp_logo</title>
  9.         <meta name="description" content="此版本为镜花水月根据网络资源所修改,兼容chrome,firefox,safari等主流浏览器">
  10.         <meta name="keywords" content="CSS3绘制ThinkPHP的logo图标">
  11.         <style type="text/css">
  12.             .border{border: 1px solid #000;width:200px;margin: 0 auto}
  13.             #logo,#left,#right,#bottom{width: 200px;height: 200px;}
  14.             #logo{
  15.                 background-color: #84C255;
  16.                 border-top-left-radius:30px;
  17.                 border-bottom-right-radius:30px; 
  18.                 overflow: hidden;
  19.                 position: relative; 
  20.             }
  21.             #left{ 
  22.                 -webkit-transform: rotate(45deg);
  23.                 -moz-transform: rotate(45deg);
  24.                 -o-transform: rotate(45deg);
  25.                 left: -140px;
  26.                 background-color: #6FB737;
  27.                 position: absolute;
  28.             }
  29.             #right{
  30.                 -webkit-transform: rotate(45deg);
  31.                 -moz-transform: rotate(45deg);
  32.                 -o-transform: rotate(45deg);
  33.                 right: -140px;
  34.                 background-color: #6FB737;
  35.                 position: absolute;
  36.             }
  37.             #bottom{
  38.                 -webkit-transform: rotate(45deg);
  39.                 -moz-transform: rotate(45deg);
  40.                 -o-transform: rotate(45deg);
  41.                 top: 140px;
  42.                 background-color: #5E9C2F;
  43.                 position: absolute;
  44.             }
  45.             .line{
  46.                 position: relative;
  47.                 border-left: 38px solid white;
  48.                 width: 40px;
  49.                 height: 70px;
  50.                 border-bottom-left-radius: 78px 60px;
  51.             }
  52.             .right{
  53.                 -webkit-transform: rotate(-120deg);
  54.                 -moz-transform: rotate(-120deg);
  55.                 -o-transform: rotate(-120deg);
  56.             }
  57.             .left{
  58.                 -webkit-transform: rotate(60deg);
  59.                 -moz-transform: rotate(60deg);
  60.                 -o-transform: rotate(60deg);
  61.             }
  62.             #line1_right{
  63.                 top:20px;
  64.                 left: -28px;
  65.             }
  66.             #line1_left{
  67.                 top:19px;
  68.                 left: -68px;
  69.             }
  70.             #line2_right{
  71.                 top:-70px;
  72.                 left: 10px;
  73.             }
  74.             #line2_left{
  75.                 top:-71px;
  76.                 left: -30px;
  77.             }    
  78.             #line3_right{
  79.                 top:-160px;
  80.                 left: 48px;
  81.             }
  82.             #line3_left{
  83.                 top:-161px;
  84.                 left: 10px;
  85.             }    
  86.         </style>
  87.     </head>
  88.     <body>
  89.         <center class="border">
  90.             <div id="logo">
  91.                 <div id="left"></div>
  92.                 <div id="right"></div>
  93.                 <div id="bottom"></div>
  94.                 <div class="line right" id="line1_right"></div>
  95.                 <div class="line left" id="line1_left"></div>
  96.                 <div class="line right" id="line2_right"></div>
  97.                 <div class="line left" id="line2_left"></div>
  98.                 <div class="line right" id="line3_right"></div>
  99.                 <div class="line left" id="line3_left"></div>
  100.             </div>
  101.         </center>
  102.     </body>
  103. </html>