温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

CSS制作的三角形和圆形小按钮代码分享

发布时间:2021-08-10 21:05:53 来源:亿速云 阅读:132 作者:chen 栏目:web开发

这篇文章主要介绍“CSS制作的三角形和圆形小按钮代码分享”,在日常操作中,相信很多人在CSS制作的三角形和圆形小按钮代码分享问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”CSS制作的三角形和圆形小按钮代码分享”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!

参考了天猫、微博等网站的做法,用纯html和css实现,效果还是不错的。
以下是成果,兼容主流浏览器,包括ie6。
CSS制作的三角形和圆形小按钮代码分享

CSS Code复制内容到剪贴板

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"             "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">   

  2. <html xmlns="http://www.w3.org/1999/xhtml">   

  3.   

  4. <head>   

  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />   

  6. <meta http-equiv="Content-Language" content="zh-CN" />   

  7. <meta name="Keywords" content="" />   

  8. <meta name="Description" content="" />   

  9. <title></title>   

  10. </head>   

  11. <style type="text/css">   

  12. *{margin:0; padding:0; list-style:nonefont:normal 12px/150% 宋体; }   

  13. body{ padding:20px; }   

  14. .arrow{ margin-bottom:20px;  }   

  15.   

  16. /* css三角形 */  

  17. .arrow,.arrow s { position:relative;  display:blockfont-size: 0; line-            height: 0; width: 0; height: 0; border-color:transparentborder-style:dashedborder-width:5px; }   

  18. .arrowR,.arrowR s{ border-left-color:#aaaborder-left-style:solid; }   

  19. .arrowR s{ border-left-color:#fffposition:absoluteleft:-7pxtop:-5px; }   

  20. .arrowR:hover{ border-left-color:#f60;  }   

  21.   

  22. .arrowL,.arrowL s{ border-right-color:#aaaborder-right-style:solid; }   

  23. .arrowL s{ border-right-color:#fffposition:absoluterightright:-7pxtop:-5px; }   

  24. .arrowL:hover{ border-right-color:#f60;  }   

  25.   

  26. .arrowT,.arrowT s{ border-bottom-color:#aaaborder-bottom-style:solid; }   

  27. .arrowT s{ border-bottom-color:#fffposition:absoluteleft:-5pxtop:-3px; }   

  28. .arrowT:hover{ border-bottom-color:#f60;  }   

  29.   

  30. .arrowB,.arrowB s{ border-top-color:#aaaborder-top-style:solid; }   

  31. .arrowB s{ border-top-color:#fffposition:absoluteleft:-5pxbottombottom:-3px; }   

  32. .arrowB:hover{ border-top-color:#f60;  }   

  33.   

  34. /* css圆形 */  

  35. .circleline-height:100%; overflow:hidden;  font-    family:Tahoma,Helveticafont-size:18pxcolor:#aaa;  }   

  36. .circle:hover{ color:#f60;  }   

  37.   

  38.   

  39. /* 提示盒子 */  

  40. .tipBox{ width:200pxmargin-top:10px;   }   

  41. .tipBox .hd{ height:5px;  position:relative;  }   

  42. .tipBox .hd .arrow{ position:absolutetop:-5pxleft:10px; }   

  43. .tipBox .hd .arrow s{ top:-4px; }   

  44. .tipBox .bd{ border:1px solid #aaapadding:10px;  -webkit-border-    radius:5px; -moz-border-radius:5pxborder-radius:5px;  }   

  45. .tipBoxA .arrow s{ border-bottom-color:#f6f6f6;  }   

  46. .tipBoxA .bd{ background:#f6f6f6;  }   

  47. </style>   

  48. <body>   

  49. <a class="arrow arrowR"></a>   

  50. <a class="arrow arrowL"></a>   

  51. <a class="arrow arrowT"></a>   

  52. <a class="arrow arrowB"></a>   

  53.   

  54. <a class="arrow arrowR"><s></s></a>   

  55. <a class="arrow arrowL"><s></s></a>   

  56. <a class="arrow arrowT"><s></s></a>   

  57. <a class="arrow arrowB"><s></s></a>   

  58.   

  59. <a class="circle">?</a>   

  60.   

  61. <div class="tipBox">   

  62. <div class="hd">   

  63. <s class="arrow arrowT"><s></s></s>   

  64. </div>   

  65. <div class="bd">   

  66. 用css做的提示盒子,上三角是纯css,盒子圆角用到css3   

  67. </div>   

  68. </div>   

  69. <div class="tipBox tipBoxA">   

  70. <div class="hd">   

  71. <s class="arrow arrowT"><s></s></s>   

  72. </div>   

  73. <div class="bd">   

  74. 用css做的提示盒子,上三角是纯css,盒子圆角用到css3   

  75. </div>   

  76. </div>   

  77. </body>   

  78.   

  79. </html>  

到此,关于“CSS制作的三角形和圆形小按钮代码分享”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注亿速云网站,小编会继续努力为大家带来更多实用的文章!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

css
AI