我正在为我的网站使用粘性页脚设计,这是我从 Ben Frain 的 Responsive Web Design with HTML5 and CSS3(第二版)中采用的。它在主要的现代浏览器上运行良好,但在 Samsung Galaxi Note 2 内置浏览器上运行不佳。我想知道为什么? .欢迎任何解释或建议,包括来自 iphone 用户的任何反馈。
<!doctype html>
<html>
<head>
<meta charset="iso-8859-1">
<title>Sticky footer</title>
</head>
<style type="text/css">
html, body{
margin: 0;
padding:0;
}
html{
height: 100%;
}
body{
display: flex;
flex-direction: column;
min-height: 100%;
}
#header{
background-color: #0FF;
}
#MainContent{
flex: 1;
}
#footer{
background-color: #0F9;
}
</style>
<body>
<div id="header">This is the header</div>
<div id="MainContent">This is the main content</div>
<div id="footer">This is the footer</div>
</body>
</html>
最佳答案
内置浏览器的三星 Galaxy Note 2 无法正确处理 html5 flexbox 概念,即使将 -webkit.请改用 Chrome 或 FireFox。
关于android - 为什么粘性页脚在内置浏览器的三星智能手机 Note 2 上不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35985012/