一个app的底部导航

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title></title>

    <link rel="shortcut icon" href="favicon.ico">
    <link href="css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link rel="stylesheet" href="css/bootstrap.min.css" />
    <script type="text/javascript" src="js/jquery.min.js" ></script>

    <style>
        /*顶部图片信息*/
        .myTop{
            position: absolute;
            top: 0;
            width: 100%;
            height: 40%;
            overflow: hidden;
        }

        .myTop-img img{
            width: 100%;
        }

        .myTop-img-back{
            position: absolute;
            width: 100%;
            height: 100%;
            background: linear-gradient(45deg, #0055B2 , #ffffff);
            opacity: 0.8;

        }
        .myTop-font{
            position: absolute;
            bottom: 0;
            height: 50%;
            width: 100%;
            color: #FFFFFF;
            z-index: 1000;
            font-family: "微软雅黑";
            font-size: 18px;
            text-indent: 20px;
        }
        .liu{
            font-size: 30px;
        }

        /*底部导航*/
        .myFoot{
            border-top: 1px solid #E0E0E0;
            position: fixed;
            bottom: 0;
            width: 100%;
            height: 50px;
            background-color: #ffffff;
        }

        /*内容部分*/
        .myCont{
            margin-top: 72%;
            margin-bottom: 13%;
        }
        .gxp img{
            width: 40px;
            border-radius: 50%;
            border: 2px solid #FFFFFF;
            margin: auto 5px;
        }
        .row img{
            margin: 5px auto;
        }
        .myFoot a{
            color: #7F7F7F;
            text-align: center;
            line-height: 50px;
        }
    </style>

    <script type="text/javascript">

        $(document).ready(function(){

            $(".myFoot a").click(function(){

                //改变当前被点击的元素样式
                $(this).css({
                    "color":"#0062FA"
                });

                //还原同胞元素
                $(this).siblings().css({
                    "color":"#7F7F7F"
                });


            });

        });

    </script>
</head>
<body>

    <!--顶部图片信息-->
    <div class="myTop">

        <div class="myTop-font">

            <p class="liu">刘德华</p>
            <p style="float: left;" >Andy Lau </p>
            <p style="float: right;margin-right: 20px;">
                <i class="fa fa-map-marker"></i>&nbsp;&nbsp;中国&nbsp;·&nbsp;香港
            </p>

            <hr style="clear: both;width: 95%;margin:60px auto 20px;" />


            <p style="float: left;">关系谱</p>
            <div class="gxp" style="float: right;margin-right: 20px;">
                <img src="img/a1.jpg" />
                <img src="img/a2.jpg" />
                <img src="img/a3.jpg" />
                <img src="img/a4.jpg" />
                <i class="fa fa-chevron-right"></i>
            </div>
        </div>

        <!--蒙版-->
        <div class="myTop-img-back"></div>

        <!--背景图片-->
        <div class="myTop-img">
            <img src="img/timg.jpg"/>
        </div>

    </div>

    <!--内容部分-->
    <div class="myCont container">


        <p style="font-size: 20px;font-family: '微软雅黑';text-align: center;">作品展示</p>

        <div class="row">
            <img class="col-xs-6 img-thumbnail" src="img/a1.jpg" />
            <img class="col-xs-6 img-thumbnail" src="img/a1.jpg" />
            <img class="col-xs-6 img-thumbnail" src="img/a1.jpg" />
            <img class="col-xs-6 img-thumbnail" src="img/a1.jpg" />
            <img class="col-xs-6 img-thumbnail" src="img/a1.jpg" />
            <img class="col-xs-6 img-thumbnail" src="img/a1.jpg" />
            <img class="col-xs-6 img-thumbnail" src="img/a1.jpg" />

        </div>

    </div>


    <!--底部导航-->
    <div class="myFoot container-fluid">

        <div class="row">
            <a class="col-xs-4" href="javascript:;">
                <i class="fa fa-book"></i>
                最新作品
            </a>
            <a class="col-xs-4" href="javascript:;">
                <i class="fa fa-book"></i>
                绯闻八卦
            </a>
            <a class="col-xs-4" href="javascript:;">
                <i class="fa fa-book"></i>
                关系谱
            </a>
        </div>


    </div>

</body>
</html>
可以使用vue-router和vue-awesome-swiper第三方库来实现一个带有底部导航栏的手机app界面。 首先,在main.js中导入vue-router和vue-awesome-swiper: ``` import Vue from 'vue' import VueRouter from 'vue-router' import VueAwesomeSwiper from 'vue-awesome-swiper' import 'swiper/dist/css/swiper.css' Vue.use(VueRouter) Vue.use(VueAwesomeSwiper) ``` 然后,创建一个App.vue组件,包含底部导航栏和路由视图: ``` <template> <div id="app"> <div class="main"> <router-view></router-view> </div> <div class="tabbar"> <router-link to="/" class="tabbar-item"> <i class="iconfont icon-home"></i> <span>首页</span> </router-link> <router-link to="/category" class="tabbar-item"> <i class="iconfont icon-category"></i> <span>分类</span> </router-link> <router-link to="/cart" class="tabbar-item"> <i class="iconfont icon-cart"></i> <span>购物车</span> </router-link> <router-link to="/profile" class="tabbar-item"> <i class="iconfont icon-profile"></i> <span>我的</span> </router-link> </div> </div> </template> <script> export default { name: 'App' } </script> <style> .tabbar { display: flex; position: fixed; bottom: 0; left: 0; width: 100%; background-color: #fff; box-shadow: 0 -2px 4px rgba(0,0,0,.15); z-index: 99; } .tabbar-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #999; font-size: 12px; text-decoration: none; } .tabbar-item.active { color: #33a3f4; } .tabbar-item i { font-size: 20px; margin-bottom: 2px; } .main { margin-bottom: 50px; } </style> ``` 在路由配置文件中,定义每个路由对应的组件: ``` import Vue from 'vue' import Router from 'vue-router' import Home from './views/Home.vue' import Category from './views/Category.vue' import Cart from './views/Cart.vue' import Profile from './views/Profile.vue' Vue.use(Router) export default new Router({ routes: [ { path: '/', component: Home }, { path: '/category', component: Category }, { path: '/cart', component: Cart }, { path: '/profile', component: Profile } ] }) ``` 最后,在各个页面组件中,使用vue-awesome-swiper实现轮播图等效果。 以上就是一个简单的带有底部导航栏的手机app界面的实现。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值