div固定在屏幕底部

您所在的位置:网站首页 div悬浮在iframe div固定在屏幕底部

div固定在屏幕底部

2024-06-11 23:16| 来源: 网络整理| 查看: 265

 

项目中需要实现div一直显示在屏幕的底部,不管页面有多长或者多端都需要满足。

在网上找的用js实现的,移动时会闪动,效果不是特别好。也可能是没找到好的。

相比js,我更希望使用css实现 1 DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2  3  4

5 html,body { 6 width:100%; 7 height:100%; 8 margin:0px; 9 padding:0px; 10 overflow:hidden; 11 } 12 #Main { 13 position:absolute; 14 bottom:0px; 15 left:0px; 16 width:100%; 17 height:100%; 18 overflow:auto; 19 z-index:1; 20 } 21 #ToolBar { 22 position:absolute; 23 bottom:0px; 25 width:100%; 26 height:auto; 27 text-align:center; 28 background:#ccc; 29 z-index:2; 30 overflow:hidden; 31 } 33 34 35 36 固定在页面底部不动 37 38 我是内容,我足够大吧 39 40

 



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3