2014-02-18 134 views
0

我有3種不同的樣式表,一種用於PC屏幕,一種用於智能手機,如iPhone5S,三星Galaxy S4 ...以及另一款用於小型智能手機,如我的三星Galaxy mini。響應式css無法正常工作

這是我寫的我的鏈接在我的HTML文件:

<link media="handheld, only screen and (max-width: 300px), only screen and (max-device-width: 300px)" href="StylesheeetSmallSphone.css" type="text/css" rel="stylesheet" /> 
    <link media="handheld, only screen and (min-width:301px) and (max-width: 480px), only screen and (min-device-width:301px) and (max-device-width: 480px)" href="StylesheetLargeSPhone.css" type="text/css" rel="stylesheet" /> 
    <link media="Screen" rel="stylesheet" type="text/css" href="StylesheetPC.css" /> 

上的每個設備,應用CSS是最後一個。我需要改變什麼才能讓每臺設備都顯示自己的CSS?

+0

你在你的HTML頭部分添加元視口標籤? https://developer.mozilla.org/en-US/docs/Mozilla/Mobile/Viewport_meta_tag – sinisake

+0

否...但不會使用這意味着我必須指定特定頁面的特定設備?我試圖在不同的設備上運行相同的站點,只需使用不同的CSS類。 –

+0

不,一切都可以在桌面上正常工作......嘗試一下,如果鏈接屬性的語法是可以的...... – sinisake

回答

0

試試吧..

<link rel="stylesheet" type="text/css" media="only screen and (max-device-width: 480px)" href="small-device.css" /> 
0

你的意思EXCLUSIVELY最後一個或者也是最後一個?