当前位置:   article > 正文

如何用html来创建一个三角图标_html li标签前面加三角形

html li标签前面加三角形

1.废话不多说直接上代码,事实说话

  1. <div class="list">列表
  2. <i class="list-shadow1"></i>
  3. <ul class="top-nav">
  4. <li><a href="javascript:void(0)">列表1</a></li>
  5. <li><a href="javascript:void(0)">列表2</a></li>
  6. <li><a href="javascript:void(0)">列表3</a></li>
  7. <li><a href="javascript:void(0)">列表4</a></li>
  8. </ul>
  9. /div>
  1. .list{
  2. position: relative;
  3. width: 70px;
  4. height: 35px;
  5. line-height: 35px;
  6. margin-left: 10px;
  7. background-color: #000000;
  8. color: #f1f1f1;
  9. text-align: center;
  10. }
  11. .top-nav{
  12. position: absolute;
  13. top: 35px;
  14. width: 90px;
  15. display: none;
  16. padding-top: 10px;
  17. border: 1px solid #999999;
  18. }
  19. .top-nav>li{
  20. height: 30px;
  21. line-height: 30px;
  22. font-size: 14px;
  23. background-color: #FAFAFA;
  24. }
  25. .top-nav>li>a{
  26. display:inline-block;
  27. width: 90px;
  28. text-align: center;
  29. color: #696969;
  30. }
  31. .list:hover{
  32. cursor: pointer;
  33. }
  34. .top-nav>li:hover{
  35. background-color: #ccccCC;
  36. }
  37. .list:hover .top-nav{
  38. display: block;
  39. }
  40. .list-shadow1{
  41. position: absolute;
  42. top: 17px;
  43. margin-left: 5px;
  44. border-color: #DDD transparent transparent transparent;
  45. border-style: solid dashed dashed dashed;
  46. border-width:5px;
  47. }
  48. .list:hover .list-shadow1{
  49. position: absolute;
  50. margin-top: -5px;
  51. border-color: transparent transparent #E64E3E transparent;
  52. border-style: dashed dashed solid dashed;
  53. }

2.效果查看演示

<a title="查看演示效果" href=" https://leader755.github.io/checkbox-fillter/ " target="_blank" >点我查看演示效果</a>

<a title="下载源码" href=" https://github.com/Leader755/checkbox-fillter.git " target="_blank">点我下载源码</a>
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/328835
推荐阅读
相关标签
  

闽ICP备14008679号