这篇文章主要介绍了一波css制作的三角形和圆形小按钮示例,都采用了灰色的常见按钮样式设计,需要的朋友可以参考下
参考了天猫、微博等网站的做法,用纯html和css实现,效果还是不错的。
以下是成果,兼容主流浏览器,包括ie6。
<!doctype html public "-//w3c//dtd xhtml 1.0 strict//en"             "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd">   <html xmlns="http://www.w3.org/1999/xhtml">   <head>   <meta http-equiv="content-type" content="text/html; charset=utf-8" />   <meta http-equiv="content-language" content="zh-cn" />   <meta name="keywords" content="" />   <meta name="description" content="" />   <title></title>   </head>   <style type="text/css">   *{margin:0; padding:0; list-style:none; font:normal 12px/150% 宋体; }   body{ padding:20px; }   .arrow{ margin-bottom:20px;  }   /* css三角形 */.arrow,.arrow s { position:relative;  display:block; font-size: 0; line-            height: 0; width: 0; height: 0; border-color:transparent; border-style:dashed; border-width:5px; }   .arrowr,.arrowr s{ border-left-color:#aaa; border-left-style:solid; }   .arrowr s{ border-left-color:#fff; position:absolute; left:-7px; top:-5px; }   .arrowr:hover{ border-left-color:#f60;  }   .arrowl,.arrowl s{ border-right-color:#aaa; border-right-style:solid; }   .arrowl s{ border-right-color:#fff; position:absolute; rightright:-7px; top:-5px; }   .arrowl:hover{ border-right-color:#f60;  }   .arrowt,.arrowt s{ border-bottom-color:#aaa; border-bottom-style:solid; }   .arrowt s{ border-bottom-color:#fff; position:absolute; left:-5px; top:-3px; }   .arrowt:hover{ border-bottom-color:#f60;  }   .arrowb,.arrowb s{ border-top-color:#aaa; border-top-style:solid; }   .arrowb s{ border-top-color:#fff; position:absolute; left:-5px; bottombottom:-3px; }   .arrowb:hover{ border-top-color:#f60;  }   /* css圆形 */.circle{ line-height:100%; overflow:hidden;  font-    family:tahoma,helvetica; font-size:18px; color:#aaa;  }   .circle:hover{ color:#f60;  }   /* 提示盒子 */.tipbox{ width:200px; margin-top:10px;   }   .tipbox .hd{ height:5px;  position:relative;  }   .tipbox .hd .arrow{ position:absolute; top:-5px; left:10px; }   .tipbox .hd .arrow s{ top:-4px; }   .tipbox .bd{ border:1px solid #aaa; padding:10px;  -webkit-border-    radius:5px; -moz-border-radius:5px; border-radius:5px;  }   .tipboxa .arrow s{ border-bottom-color:#f6f6f6;  }   .tipboxa .bd{ background:#f6f6f6;  }   </style>   <body>   <a class="arrow arrowr"></a>   <a class="arrow arrowl"></a>   <a class="arrow arrowt"></a>   <a class="arrow arrowb"></a>   <a class="arrow arrowr"><s></s></a>   <a class="arrow arrowl"><s></s></a>   <a class="arrow arrowt"><s></s></a>   <a class="arrow arrowb"><s></s></a>   <a class="circle">?</a>   <p class="tipbox">   <p class="hd">   <s class="arrow arrowt"><s></s></s>   </p>   <p class="bd">   用css做的提示盒子,上三角是纯css,盒子圆角用到css3   </p>   </p>   <p class="tipbox tipboxa">   <p class="hd">   <s class="arrow arrowt"><s></s></s>   </p>   <p class="bd">   用css做的提示盒子,上三角是纯css,盒子圆角用到css3   </p>   </p>   </body>   </html>
以上就是本文的全部内容,希望对大家的学习有所帮助,更多相关内容请关注!
相关推荐:
css弹窗居中的实现方法
以上就是关于css制作的三角形和圆形小按钮的代码的详细内容。
   
 
   