2015-06-10 129 views
0

嗨,我正在實施一個網站的響應式設計。雖然設計在firefox中可以正常工作,但它在PC和移動設備上都不會出現問題。樣式表styles-RWD.css是這樣的媒體查詢不在鉻中工作

/*CSS FOR MOBILE DEVICES*/ 

@media screen and (min-width: 0px) and (max-width: 480px) { 

#sidebar { 
    display : none; 
} 

footer { 
    display : none; 
} 
#bann_cb { 
    display : none; 
} 

body { 
width:auto; 
background-color:white; 
font-family: sans-serif; 
color:orange; 
margin:0px 2px 2px 2px; 
padding:0; 
} 
#header { 
display : none; 
} 

#content { 
width:50%; 
padding:0px 2px 2px 2px; 
} 
#box_bharat { 
display:none; 
} 

#form { 
width:auto; 
padding:none; 

} 
#menu-bar { 
width:auto; 
} 

#news_10 { 
display:none; 
} 
#mob_heading { 
display:block; 
width:auto; 
visibility:visible; 
} 

} 
/*end css for mobile devices*/ 

默認樣式在此之後。

的index.php文件有這些線路

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> 
<link rel="stylesheet" type="text/css" href="styles-rwd.css" /> 

現在這個工作在Firefox,但不是在鉻。在鉻中,它甚至不會觸發。我已經在電腦上測試過。當我減小Firefox的瀏覽器窗口大小時,會觸發佈局。但這不會發生在Chrome上。在移動設備上也是如此。請幫助。

回答

0
// media screen only supports max-width 
@media screen and (max-width: 480px) { 

} 
+0

請參考?您可以使用任何有效的CSS屬性作爲條件。 –

+0

我糾正了它。即使現在它不適用於Chrome。 – user2649343