css头部和尾部固定,中间可以动态

mhxy13867806343      2022-02-10     734

关键词:

  1 <template>
  2   <div id="app">
  3     <router-view/>
  4 
  5       <div class="dHead list list-purpose dTitle" >
  6         <transition  enter-active-class="animated     zoomInLeft"
  7                      leave-active-class="animated zoomInRight">
  8             <span v-show="headtitle">
  9             {{headtitle}}</span>
 10         </transition>
 11       </div>
 12     <div class="content dBody">
 13       <loading></loading>
 14       <p class="mycontent">
 15        中间内容
 16 
 17          
 18       </p>
 19     </div>
 20     <div class="link dFoot list list-purpose">
 21 
 22       <span class="urllist"  v-for="(item,index) in urllist"
 23             @click="activtoggle(index);btnbool=!btnbool">
 24         <router-link :to="{name:item.url}":title="item.title"
 25         >
 26           <span  class="iconfont" :class="[{‘active‘:index===active},item.icon]"
 27 
 28           ></span>
 29         </router-link>
 30       </span>
 31       <div class="both"></div>
 32     </div>
 33   </div>
 34 </template>
 35 
 36 <script>
 37   import {arrText} from @/common/js/variable
 38   import Loading from base/loading
 39 export default {
 40   name: app,
 41   data(){
 42     return{
 43       btnbool:true,
 44       active:0,
 45       headtitle:首页,
 46       urllist:[
 47         {
 48           url:/,
 49           title:首页,
 50           id:index,
 51           icon:icon-shouye
 52         },
 53         {
 54           url:/infor,
 55           title:消息,
 56           id:informat,
 57           icon:icon-xiaoxi
 58         },
 59         {
 60           url:/search,
 61           title:搜索,
 62           id:search,
 63           icon:icon-search_icon
 64         },
 65         {
 66           url:/mes,
 67           title:个人中心,
 68           id:mes,
 69           icon:icon-user
 70         },
 71       ]
 72     }
 73   },
 74   components:{
 75     Loading
 76   },
 77   methods:{
 78     activtoggle(index){
 79       this.active=index
 80       this.headtitle=arrText[index]
 81     },
 82     activesty(bool){
 83       bool=!bool
 84     }
 85 
 86   }
 87 }
 88 </script>
 89 
 90 <style>
 91 #app {
 92   font-family: ‘Avenir‘, Helvetica, Arial, sans-serif;
 93   -webkit-font-smoothing: antialiased;
 94   -moz-osx-font-smoothing: grayscale;
 95   /*text-align: center;*/
 96   /*color: #2c3e50;*/
 97   /*margin-top: 60px;*/
 98 }
 99 html, body,#app {
100   height:100%;
101   overflow:hidden
102 }
103 .dHead{
104   z-index:5;
105   top:0;
106 }
107 
108 .dHead .dHead-title span{
109   position: absolute;
110 }
111 .dHead span{
112   font-size: 14px;
113   font-weight: 100;
114 }
115 .dFoot{
116   z-index:200;
117   bottom:0;
118 }
119 
120 .dBody {
121   background:#FC0;
122   width:100%;
123   overflow:auto;
124   top:60px;
125   position:absolute;
126   z-index:10;
127   bottom:60px;
128 }
129 
130 .list-purpose{
131   height:60px;
132   line-height:60px;
133   text-align:center;
134   width:100%;
135   position:absolute;
136 }
137 
138 .mycontent {
139   padding:20px;
140 }
141 .list-purpose span.urllist{
142   width: 25%;
143    box-sizing: border-box;
144   float: left;
145 }
146 .list-purpose span.urllist a{
147   display: block;
148 }
149 .list-purpose span.urllist a span.iconfont{
150   font-size: -webkit-xxx-large;
151   font-size:xx-large;
152 }
153 .both{
154   display: table;
155   clear: both;
156 }
157 
158 .fade-enter {
159   opacity:1;
160 }
161 .fade-leave{
162   opacity:0;
163 }
164 .fade-enter-active{
165   transition:opacity .5s;
166 }
167 .fade-leave-active{
168   opacity:0;
169   transition:opacity .5s;
170 }
171 
172 
173 </style>
174 <style lang="stylus" rel="stylesheet/stylus">
175 @import "~css/index.styl"
176 .dTitle
177   color $text-color
178   background-color $background-color
179 .router-link-active
180   span.active
181     color $index-color
182 
183 
184 </style>

 

如何设置css让页面头部和底部固定中间内容滚动?

就是头部贴页面顶部,底部贴页面底部。全屏的时候,刚好页面是没有滚动条的。当页面缩小的时候,头部和底部还是固定在两头,让中间部分产生滚动条。页面分成了三个部分,三个部分分开写在不同的页面里,然后调用。整... 查看详情

移动端尾部和头部固定

<!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"><metaname="viewport"content="width=device-width,initial-scale=1.0"><metahttp-equiv="X-UA-Compatible"content="ie 查看详情

div固定宽度和动态拉伸混合水平排列

1.效果图  2.源代码html<h2>1.头部固定,尾部拉伸</h2><divclass="container"id="div1"><divclass="head"></div><divclass="tail"></div></div><h2>2.尾部固定,头部拉伸&l 查看详情

python去除空格的方法(代码片段)

...意replace第一个冒号中间有一个空格)#去掉全部空格头部,尾部,中间key=input("输入内容").replace("","")print("我是头部:"+key+":我是尾部")实现效果 使用join和spilt #去掉全部空格头部... 查看详情

jquery-mobile.js这个做手机页面,怎么只让他中间组件可以上下拉动,而头部和底部组件,不动,一直显示

...做手机页面,怎么只让他中间组件表格可以上下拉动,而头部和底部组件,不动,一直显示在手机屏幕上面,有啥css或是js代码来设置呢??类似position:fixed用于生成绝对定位的元素,但却不是使用这个方法呢?求大神指教,求... 查看详情

将css放在头部,js放在尾部可以优化页面???

...问题: 1.在进行页面优化的时候,需要将css放在头部,将js文件放在尾部,这样做为什么能够实现页面的优化?   2.在使用jquery的时候,为什么把函数写在$(document).ready()事件中?   3.javascript会阻塞dom的... 查看详情

可添加头部尾部recyclerview,很帅哦~

WrapRecyclerView是一个可以添加头部和尾部的RecyclerView,并且提供了一个WrapAdapter,它可以让你轻松为RecyclerView添加头部和尾部。 示例中轮转图使用了Android-LoopView,使用它你可以轻松实现轮转大图。是不是很心动?那么抓紧来staror... 查看详情

stl容器及适配器

...素。在数组尾部添加或删除元素非常快速,但是在中部或头部插入或删除元素比较耗时。deque“double-endedqueue”双端队列,可以随机存取。数组尾部或头部添加 查看详情

使用iframe的方式实现共用的头部和尾部页面(代码片段)

在前端开发中,有些页面的头部和尾部是一模一样的,如果我们每个页面都重新写一次,那样会很麻烦,这时候我们可以将头部和尾部提取出来,让所有的页面都可以复用头部和尾部,减轻我们的工作量。... 查看详情

androidlistview添加头部和尾部(代码片段)

ListView添加头部和尾部:头部布局:addHeaderView尾部布局:addFooterView使用java代码://添加头部finalViewheader=View.inflate(this,R.layout.layout_header,null);listView.addHeaderView(header);//添加尾部f 查看详情

iostableview不让头部和尾部跟随

-(void)scrollViewDidScroll:(UIScrollView*)scrollView{UITableView*tableview=(UITableView*)scrollView;CGFloatsectionHeaderHeight=AutoWHGetHeight(50);CGFloatsectionFooterHeight=AutoWHGetHeight(0);CGFloat 查看详情

angularjs中ng-include指令实现头部和尾部的共用(代码片段)

...用AngularJS的时候,我们可以使用ng-include指令实现页面头部和尾部的共用,。不过在使用ng-include指令的时候也是需要注意一些细节的。就是共用的头部和尾部的路径在ng-include中写法<!DOCTYPEhtml><htmllang="en">... 查看详情

布局问题:(头部,底部固定,并且头部吸顶,底部吸底,中间自适应(内容多可以scroll))(代码片段)

1<!DOCTYPEhtml>2<htmllang="en">3<head>4<metacharset="UTF-8">5<metaname="viewport"content="width=device-width,initial-scale=1.0">6<metahttp-equiv="X-UA-Compatible"content="ie=edge">7<title>Document</title>8<style>9html,body,ul,li,p10margin:0;11pad... 查看详情

python pandas同时选择头部和尾部

】pythonpandas同时选择头部和尾部【英文标题】:pythonpandasselectbothheadandtail【发布时间】:2017-07-1904:50:26【问题描述】:对于Pandas中的DataFrame,如何同时选择前5个值和后5个值?例如In[11]:dfOut[11]:ABC2012-11-290002012-11-301112012-12-012222012-... 查看详情

静态的html,怎么共用头部和尾部?

不要用那种iframe的.谢谢参考技术A用包含文件<!include--(+含有头代码的文件名)> 查看详情

在R中结合头部和尾部方法

】在R中结合头部和尾部方法【英文标题】:combiningheadandtailmethodsinR【发布时间】:2012-07-2023:20:02【问题描述】:我经常使用R包utils中的head(d)和tail(d)方法——经常一个接一个。所以我为这两个函数写了一个简单的包装器:ht<-fu... 查看详情

markdown利用立即执行函数引入公共头部和尾部(代码片段)

查看详情

按行读取文本文件的头部、尾部和向后

】按行读取文本文件的头部、尾部和向后【英文标题】:head,tailandbackwardreadbylinesofatextfile【发布时间】:2011-08-1906:13:31【问题描述】:如何在python中实现\'head\'和\'tail\'命令并通过文本文件的行向后读取?【问题讨论】:Readafilein... 查看详情