2016-03-09 31 views
0

首先,我认为Ryan的粘滞页脚很棒。非常兼容易于实现。它在这里,如果你以前没有http://ryanfait.com/html5-sticky-footer/Ryan的粘滞页脚的移动浏览器错误

* { 
margin: 0; 
} 
html, body { 
height: 100%; 
} 
.wrapper { 
min-height: 100%; 
margin: 0 auto -155px; /* the bottom margin is the negative value of the footer's height */ 
} 
footer, .push { 
height: 155px; /* '.push' must be the same height as 'footer' */ 
} 

/* 

Sticky Footer by Ryan Fait 
http://ryanfait.com/ 

*/ 

我的问题,虽然是看到/听到它。我已经实现了它,它很好用,但在我的移动浏览器中有一个错误。随着瑞恩的粘滞页脚实现移动浏览器的网址栏不会自动隐藏,当我向下滚动时,它只停留在那里,占用宝贵的空间。不好。

所以我把它缩小到了100%的身高。当我删除,移动浏览器的url栏隐藏。大。但是页脚不粘。

有没有人遇到过这个?有没有修复?或者是瑞安的粘页脚现在有缺陷:(

+0

这可能是瑞恩的粘脚不适用于移动。尝试不同的解决方案,如:http://mystrd.at/modern-clean-css-sticky-footer/ – jaypb

+0

这就是我我正在想,谢谢我会给你一个去看看它是怎么回事 –

+1

@jaypb - 迄今为止很好,看起来像是修好了:) Ta –

回答

0

当身体的高度直接设置为100%时,可不再扩展到其内容的大小,设置最小高度来代替。

html { 
    height: 100%; 
} 

body { 
    min-height: 100%; 
} 

看到这个答案:Link

+0

它没有解决它,它打破了瑞恩的粘脚。我在这里试过了http://jsfiddle.net/gfcarv/HxKXg/ –