当前位置:主页 > 查看内容

CSS实现底部tapbar栏功能

发布时间:2021-05-12 00:00| 位朋友查看

简介:现在许多移动手机端都有底部tab栏切换的功能,最近恰巧也做到类似的功能,废话不多说,直接上代码。 先看效果图 css样式 *{ margin: 0; padding: 0; text-decoration: none; list-style: none; } .foot { width: 100%; height: 68px; background: #FFFFFF; p……

现在许多移动手机端都有底部tab栏切换的功能,最近恰巧也做到类似的功能,废话不多说,直接上代码。

先看效果图

tab栏切换

css样式

*{
           margin: 0;
           padding: 0;
           text-decoration: none;
           list-style: none;

       }
       .foot {
           width: 100%;
           height: 68px;
           background: #FFFFFF;
           position: fixed;
           bottom: 0;
           display: flex;
           justify-content: space-around;
           z-index: 999;
           /*line-height: 20px;*/
       }

       .foot li {
           height: 100%;
       }

       .foot li a {
           display: block;
           width: 100%;
           height: 100%;
           /* color: #979797;*/
       }

       .foot li a img {
           /*display: block;*/
           width: 26px;
           height: 26px;
           margin-top: 10px;
       }

       .foot li a p {
           font-size: 12px;
           width: 100%;
           text-align: center;
           /* color: #979797;*/
           margin-top: 7px;
       }
       .botm-title{
           color: #979797;
       }

       .actives {
           color: #5C91FA;
       }
       .xz-img{
           text-align: center;
       }

页面代码

<%--底部tapbar--%>
   <ul class="foot">
       <li class="Imgbox" img="/images/tuiJianCus/index-wxz-icon.png" data-img="/images/tuiJianCus/index-xz-icon.png">
           <a href="/views/tuiJianCus/index.jsp">
               <div class="xz-img">
                   <img src="/images/tuiJianCus/index-wxz-icon.png" />
               </div>

               <p class="botm-title">首页推荐</p>
           </a>
       </li>
       <li class="Imgbox" img="/images/tuiJianCus/tuijiang-wxz-icon.png" data-img="/images/tuiJianCus/tuijiang-xz-icon.png">
           <a href="/views/tuiJianCus/tuijian_speed.jsp">
               <div class="xz-img">
                   <img src="/images/tuiJianCus/tuijiang-xz-icon.png" />
               </div>

               <p class="botm-title actives ">我的推荐</p>
           </a>
       </li>
       <li class="Imgbox" img="/images/tuiJianCus/my-wxz-icon.png" data-img="/images/tuiJianCus/my-xz-icon.png">
           <a href="/views/tuiJianCus/usercenter.jsp">
               <div class="xz-img">
                   <img src="/images/tuiJianCus/my-wxz-icon.png" />
               </div>

               <p class="botm-title ">我的福利</p>
           </a>
       </li>
   </ul>

到此这篇关于CSS实现底部tapbar栏的文章就介绍到这了,更多相关css 底部tapbar栏内容请搜索脚本之家以前的文章或继续浏览下面的相关文章,希望大家以后多多支持脚本之家!


原文链接:https://m.jb51.net/css/721674.html
本站部分内容转载于网络,版权归原作者所有,转载之目的在于传播更多优秀技术内容,如有侵权请联系QQ/微信:153890879删除,谢谢!
上一篇:解决css中的匹配问题 下一篇:没有了

推荐图文


随机推荐