css头部和尾部固定,中间可以动态
2018-01-15 13:10
225 查看
<template> <div id="app"> <router-view/> <div class="dHead list list-purpose dTitle" > <transition enter-active-class="animated zoomInLeft" leave-active-class="animated zoomInRight"> <span v-show="headtitle"> {{headtitle}}</span> </transition> </div> <div class="content dBody"> <loading></loading> <p class="mycontent"> 中间内容 </p> </div> <div class="link dFoot list list-purpose"> <span class="urllist" v-for="(item,index) in urllist" @click="activtoggle(index);btnbool=!btnbool"> <router-link :to="{name:item.url}":title="item.title" > <span class="iconfont" :class="[{'active':index===active},item.icon]" ></span> </router-link> </span> <div class="both"></div> </div> </div> </template> <script> import {arrText} from '@/common/js/variable' import Loading from 'base/loading' export default { name: 'app', data(){ return{ btnbool:true, active:0, headtitle:'首页', urllist:[ { url:'/', title:'首页', id:'index', icon:'icon-shouye' }, { url:'/infor', title:'消息', id:'informat', icon:'icon-xiaoxi' }, { url:'/search', title:'搜索', id:'search', icon:'icon-search_icon' }, { url:'/mes', title:'个人中心', id:'mes', icon:'icon-user' }, ] } }, components:{ Loading }, methods:{ activtoggle(index){ this.active=index this.headtitle=arrText[index] }, activesty(bool){ bool=!bool } } } </script> <style> #app { font-family: 'Avenir', Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; /*text-align: center;*/ /*color: #2c3e50;*/ /*margin-top: 60px;*/ } html, body,#app { height:100%; overflow:hidden } .dHead{ z-index:5; top:0; } .dHead .dHead-title span{ position: absolute; } .dHead span{ font-size: 14px; font-weight: 100; } .dFoot{ z-index:200; bottom:0; } .dBody { background:#FC0; width:100%; overflow:auto; top:60px; position:absolute; z-index:10; bottom:60px; } .list-purpose{ height:60px; line-height:60px; text-align:center; width:100%; position:absolute; } .mycontent { padding:20px; } .list-purpose span.urllist{ width: 25%; box-sizing: border-box; float: left; } .list-purpose span.urllist a{ display: block; } .list-purpose span.urllist a span.iconfont{ font-size: -webkit-xxx-large; font-size:xx-large; } .both{ display: table; clear: both; } .fade-enter { opacity:1; } .fade-leave{ opacity:0; } .fade-enter-active{ transition:opacity .5s; } .fade-leave-active{ opacity:0; transition:opacity .5s; } </style> <style lang="stylus" rel="stylesheet/stylus"> @import "~css/index.styl" .dTitle color $text-color background-color $background-color .router-link-active span.active color $index-color </style>
相关文章推荐
- 手机html开发,简单实例,头部底部固定,中间可以滚动
- css前端头尾部固定,中间内容可滑动
- CSS设计网页布局(1-3-1左右固定,中间动态)示例代码
- CSS设计网页代码(1-3-1左右动态,中间固定)示例代码
- CSS网页布局(页面设计左右固定中间动态1-3-1)
- CSS网页设计(网页页面左右动态中间固定1-3-1)
- CSS实现自适应高度布局:头部底部固定,中间自适应铺满屏幕剩余高度,中间盒子里左盒子固定右盒子自适应宽度
- css中头部固定 三列两边固定宽度,中间自适应设置
- table头部、尾部固定;中间内容定高自适应滚动
- table头部、尾部固定;中间内容定高自适应滚动
- 头部和尾部固定中间自适应的布局
- 将css放在头部,js放在尾部可以优化页面???
- html页面 头部、尾部固定 中间可拖动效果
- CSS三栏布局(两边固定中间自适应宽度)的方法
- DIV/CSS 实现三列,左右两列固定,中间一列自适应
- CSS布局:三栏布局,中间栏固定宽度,左右两边自适应
- 使用CSStickyHeaderFlowLayout实现头部固定的CollectionView
- CSS之中间固定两边自适应宽度
- 前端经典面试题之CSS实现三栏布局,左右宽度固定,中间宽度自适应
- 纯css实现table表格固定列和表头,中间横向滚动的思路-附案例