自定义对勾icon,选中和未选中状态

布满荆棘的人生 2022-02-27 11:58 241阅读 0赞
  1. <html>
  2. <head>
  3. <title></title>
  4. <style type="text/css">
  5. /**绿色勾*/
  6. .myicon-tick-checked {
  7. display: inline-block;
  8. position: relative;
  9. width: 15px;
  10. height: 15px;
  11. border-radius: 50%;
  12. background-color: #2ac845;
  13. }
  14. /**灰色勾*/
  15. .myicon-tick-uncheck {
  16. display: inline-block;
  17. position: relative;
  18. width: 15px;
  19. height: 15px;
  20. border-radius: 50%;
  21. background-color: #5f646e;
  22. }
  23. .myicon-tick-checked:before, .myicon-tick-checked:after,.myicon-tick-uncheck:before,.myicon-tick-uncheck:after {
  24. content: '';
  25. pointer-events: none;
  26. position: absolute;
  27. color: white;
  28. border: 1px solid;
  29. background-color: white;
  30. }
  31. .myicon-tick-checked:before,.myicon-tick-uncheck:before {
  32. width: 1px;
  33. height: 1px;
  34. left: 25%;
  35. top: 50%;
  36. transform: skew(0deg,50deg);
  37. }
  38. .myicon-tick-checked:after,.myicon-tick-uncheck:after {
  39. width: 3px;
  40. height: 1px;
  41. left: 45%;
  42. top: 42%;
  43. transform: skew(0deg,-50deg);
  44. }
  45. </style>
  46. </head>
  47. <body>
  48. <span class="myicon-tick-checked"></span>
  49. <span class="myicon-tick-uncheck"></span>
  50. </body>
  51. </html>

效果图

20190327164149347.png

发表评论

表情:
评论列表 (有 0 条评论,241人围观)

还没有评论,来说两句吧...

相关阅读