制作思想
- subnav-entry ul大盒子,10个li
- li 里面包 a
- a 里面包 2个span
- ul 用display:flex
- li flex:20%
index.html
<!-- 侧导航栏 -->
<ul class="subnav-entry">
<li>
<a href="#">
<span class="subnav-entry-icon"></span>
<span>WiFi电话卡</span>
</a>
</li>
<li>
<a href="#">
<span class="subnav-entry-icon"></span>
<span>WiFi电话卡</span>
</a>
</li>
<li>
<a href="#">
<span class="subnav-entry-icon"></span>
<span>WiFi电话卡</span>
</a>
</li>
<li>
<a href="#">
<span class="subnav-entry-icon"></span>
<span>WiFi电话卡</span>
</a>
</li>
<li>
<a href="#">
<span class="subnav-entry-icon"></span>
<span>WiFi电话卡</span>
</a>
</li>
<li>
<a href="#">
<span class="subnav-entry-icon"></span>
<span>WiFi电话卡</span>
</a>
</li>
<li>
<a href="#">
<span class="subnav-entry-icon"></span>
<span>WiFi电话卡</span>
</a>
</li>
<li>
<a href="#">
<span class="subnav-entry-icon"></span>
<span>WiFi电话卡</span>
</a>
</li>
<li>
<a href="#">
<span class="subnav-entry-icon"></span>
<span>WiFi电话卡</span>
</a>
</li>
<li>
<a href="#">
<span class="subnav-entry-icon"></span>
<span>WiFi电话卡</span>
</a>
</li>
</ul>
index.css
/* 侧导航栏 */
.subnav-entry {
display: flex;
flex-wrap: wrap;
border-radius: 10px;
margin: 0 5px;
padding: 4px 0;
background-color: #fff;
}
.subnav-entry li {
flex: 20%;
}
.subnav-entry li a {
display: flex;
margin-top: 4px;
flex-direction: column;
align-items: center;
}
.subnav-entry-icon {
width: 28px;
height: 28px;
background: url(../images/subnav-bg.png) no-repeat;
background-size: 28px auto;
}