我有 3 种不同的样式表,一种用于 PC 屏幕,一种用于 iPhone5S、Samsung Galaxy S4 等智能手机……还有一种用于较小的智能手机,例如我的 Samsung Galaxy mini。
这是我在 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?
最佳答案
试一试..
<link rel="stylesheet" type="text/css" media="only screen and (max-device-width: 480px)" href="small-device.css" />
关于android - 响应式 CSS 无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21852128/