首先關閉所有,這些都是最好的斷點
@media (min-width:320px) { /* smartphones, iPhone, portrait 480x320 phones */ }
@media (min-width:481px) { /* portrait e-readers (Nook/Kindle), smaller tablets @ 600 or @ 640 wide. */ }
@media (min-width:641px) { /* portrait tablets, portrait iPad, landscape e-readers, landscape 800x480 or 854x480 phones */ }
@media (min-width:961px) { /* tablet, landscape iPad, lo-res laptops ands desktops */ }
@media (min-width:1025px) { /* big landscape tablets, laptops, and desktops */ }
@media (min-width:1281px) { /* hi-res laptops and desktops */ }
現在,在你的情況下,使用該媒體查詢,而不是
@media (max-width:1024px) {
html, body {
background-color: #f00;
color:#000;
}
}
你必須在文檔的開始 。這可能會使事情混亂。你應該刪除它。另外,請考慮放置HTML5文檔類型。 –
我刪除它,再次測試,但沒有任何改變。文檔聲明是<?xml version =「1.0」?>,因爲這是我見過的針對手機網站所必需的。 – plugincontainer
您有兩種聲明,其中沒有一種是HTML5文檔類型。我相信HTML5 doctype是移動網站的一種選擇。 –