2013-03-15 31 views
0

所以我想在網頁視圖(Android)中顯示this網站,它工作正常,但我不知道它爲什麼不全屏顯示。我認爲CSS必須有問題,但我無法找到它。這是我在手機中看到的截圖。我想讓背景佔據整個屏幕。這可能嗎?製作我的手機html全屏

enter image description here

+0

你嘗試'背景尺寸:100%100%;'?那麼'body {width:100%;高度:100%;}'? – 11684 2013-03-15 11:10:14

+0

是的,它不會工作。 Oswaldo Acauan的答案適用於側墊,但底部的白色條紋仍然存在。任何建議? – 2013-03-15 11:20:07

回答

1

您的 「default.css」 填充。刪除線704

@media all and (max-width: 960px){ 
    .center{ 
     width:auto; 
    } 
    ... 
} 

如果你想要一個全屏幕的表,您需要在我們的.tablatop添加position: absoluteheight: 100%

.tablatop { //remember to put this style rule in your respective @media-query!!! 
    position: absolute; 
    height: 100%; 
} 
+0

謝謝你的回答。這解決了左側和右側填充。底部的白色邊緣仍然存在:S – 2013-03-15 11:19:14

+0

@Perroloco編輯爲全屏解決方案:) – 2013-03-15 11:22:07

+0

現在它在webview中工作完美,但在我的電腦它看起來不好。沒關係,非常感謝你! – 2013-03-15 11:26:58

1

有給到div(在媒體查詢)填充(padding: 0 10px;)這就是爲什麼它走的是空間,刪除它

@media (max-width: 960px) 
.center { 
padding: 0; 
width: auto; 
} 

檢查截圖

enter image description here

+0

謝謝......我已經用Oswaldo的答案解決了它:3 – 2013-03-15 11:28:50

1

不確定關於webview,但試試這個:

body,html{ 
    width:100%; 
    height:100%; 
    padding:0px; 
    margin:0px; 
    /*optional but incase it still doesn't work.*/ 
    min-width:100%; 
    min-height:100%; 
    /*further optional still incase elements case overflows*/ 
    max-width:100%; 
    max-height:100; 
    overflow:scroll;/*or hidden*/ 

爲了進一步針對使用手機的媒體查詢,像這樣:

@media only screen and(max-device-width:(deviceWidthHere))and(max-device-height:(deviceHeightHere)){ 
    /*CSS here*/ 
    /*second 'and' clause is not necessarily necessary. lol*/ 
} 
+0

謝謝......我已經用Oswaldo的答案解決了它:3 – 2013-03-15 11:27:46

+0

@Perroloco沒問題:) – sourRaspberri 2013-03-15 11:34:03