2016-03-14 31 views
0

我爲我的網站使用了粘性頁腳設計,我已經從Ben Frain的HTML5和CSS3(第二版)採用響應式網頁設計。它在主要的現代瀏覽器上完美運行,但不在Samsung Galaxi Note 2內置瀏覽器上運行。我想知道爲什麼?歡迎任何解釋或建議,包括iphone用戶的任何反饋。爲什麼粘性頁腳不能在三星智能手機上運行注2,內置瀏覽器?

<!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> 
+1

「我的手機是三星」...三星手機是什麼型號?你在那裏使用什麼瀏覽器?根據[caniuse.com](http://caniuse.com/#feat=flexbox)舊版本的android股票瀏覽器仍然需要flexbox的'-webkit-'前綴。請更新您的問題。 – Demnogonis

+0

你可以從你的手機屏幕截圖,讓我看看它是如何顯示 – ahmdabos

+0

顯然,三星Galaxi Note 2中的內置瀏覽器不工作,因爲頁腳出現在頂部。不過基於@ahmdabos的評論,我試圖找出Samsung Galaxi Note 2上的其他瀏覽器。我剛剛發現了Chrome。 Chrome正確顯示粘性頁腳。是否有任何其他瀏覽器可用於Samsung Galaxi Note 2,例如FireFox,這是我最喜歡的瀏覽器? – MGZ

回答

0

三星Galaxi Note 2內置瀏覽器,即使通過放置-webkit,也不能正確處理html5 flexbox概念。改用Chrome或FireFox。

相關問題