2014-02-18 137 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最后一个或者也是最后一个?