为什么我的网站页脚会跑到中间来?
我清除缓存也不行,更换主题也不行。
2条回答 默认 最新
- LOVE_tenYear 2022-09-05 09:00关注
可能是你的css定义有问题,中间内容少,或者没有的时候footer就顶上去了
<template> <div class="index"> <el-container> <el-header> <div> <span>header</span> </div> </el-header> <el-main> <div> <span>content</span> </div> </el-main> <el-footer> <div c> <span class="footer-span">fotter内容</span> </div> </el-footer> </el-container> </div> </template> <style lang="scss" scoped> .index { height: 100%; width: 100%; position: absolute; top: 0; left: 0; } .el-container { width: 100%; min-height: 100%; display: flex; flex-direction: column; justify-content:space-between; } .el-main { height: 100%; overflow: hidden; } .el-footer { display: flex; height: 4vh; width: 100%; align-items: center; }
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 1无用