image.png

    1. <!-- 分类导航栏 -->
    2. <nav>
    3. <a href="#">
    4. <img src="images/nav1.png" alt="">
    5. <div class="title">苏宁秒杀</div>
    6. </a>
    7. <a href="#">
    8. <img src="images/nav2.png" alt="">
    9. <div class="title">苏宁超市</div>
    10. </a><a href="#">
    11. <img src="images/nav3.png" alt="">
    12. <div class="title">苏宁拼购</div>
    13. </a><a href="#">
    14. <img src="images/nav4.png" alt="">
    15. <div class="title">手机数码</div>
    16. </a><a href="#">
    17. <img src="images/nav5.png" alt="">
    18. <div class="title">苏宁家电</div>
    19. </a><a href="#">
    20. <img src="images/nav6.png" alt="">
    21. <div class="title">免费水果</div>
    22. </a><a href="#">
    23. <img src="images/nav7.png" alt="">
    24. <div class="title">super会员</div>
    25. </a><a href="#">
    26. <img src="images/nav8.png" alt="">
    27. <div class="title">签到有礼</div>
    28. </a><a href="#">
    29. <img src="images/nav9.png" alt="">
    30. <div class="title">领券中心</div>
    31. </a><a href="#">
    32. <img src="images/nav10.png" alt="">
    33. <div class="title">更多频道</div>
    34. </a>
    35. </nav>
    // nav
    nav {
      width: (750rem / @baseFont);
    
      a {
        float: left;//浮动的一个特性包括可以给宽高
        width: (150rem / @baseFont);
        height: (142rem / @baseFont);
    
        img {
          display: block;//img是行内元素,不能给宽和高,得把它转换为块元素
          width: (84rem / @baseFont);
          height: (84rem / @baseFont);
          margin: (5rem / @baseFont) auto 0;
        }
    
        .title {
          font-size: (22rem / @baseFont);
          text-align: center;
          margin-top: (5rem / @baseFont);
          color: #666;
        }
      }
    }