Css Twitter引导的页脚问题-z索引是解决方案吗?
我的模板基于。要保持页脚“粘性”,请使用以下CSS规则:Css Twitter引导的页脚问题-z索引是解决方案吗?,css,twitter-bootstrap,Css,Twitter Bootstrap,我的模板基于。要保持页脚“粘性”,请使用以下CSS规则: /* Sticky footer styles -------------------------------------------------- */ html { position: relative; min-height: 100%; } body { /* Margin bottom by footer height */ margin-bottom: 60px; } .footer {
/* Sticky footer styles
-------------------------------------------------- */
html {
position: relative;
min-height: 100%;
}
body {
/* Margin bottom by footer height */
margin-bottom: 60px;
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
/* Set the fixed height of the footer here */
height: 60px;
background-color: #f5f5f5;
}
/* Custom page CSS -------------------------------------------------- */
/* Not required for template or sticky footer method. */
body > .container {
padding: 60px 15px 0;
}
.container .text-muted {
margin: 20px 0;
}
.footer > .container {
padding-right: 15px;
padding-left: 15px;
}
code {
font-size: 80%;
}
但是,当我包含一个表时,分页与页脚重叠。我认为这是由于DOM规则的工作方式
有一个使用z-index
的修复程序:
.footer {
z-index: 4;
}
这是最好的办法吗
如果你看一下并将“Show entries改为100”,你就会明白我的意思。在
页脚上使用z-index
是解决方案
.footer {
z-index: 2;
}