CSS样式表,目标iPhone iPad不工作 [英] CSS stylesheet that targets iPhone iPad not working

查看:120
本文介绍了CSS样式表,目标iPhone iPad不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只有几个tweeks,使我的网站在iPad iPhone上工作,只需要改变一些边距和一些字体大小。我发现这个教程在线说,添加这个代码:

I have just a couple tweeks to make my website work on an iPad iPhone, just need to change some margins and some fonts sizes. I found this tutorial online that said to add this code:

<!--[if !IE]>-->
<link type="text/css" rel="stylesheet" media="only screen and (max-device-width: 480px)"  href="css/style_ipad.css" />
<link type="text/css" rel="stylesheet" media="only screen and (min-device-width: 768px) and (max-device-width: 1024px)" href="css/style_ipad.css" />
<!--<![endif]-->

所以我在链接上面添加了我正常的样式表,并用我的调整上传了style_ipad.css,它没有工作。任何人知道为什么这不工作?这是过时的吗?

so I added this right above the link to my normal stylesheet and uploaded style_ipad.css with my adjustments but it hasn't worked. Anyone know why this wouldn't work? Is this out of date?

推荐答案

这不是过时的,但由于您说您已在它很可能你的风格规则被覆盖。

It's not out of date, but since you said you added it above your normal stylesheet, it's quite likely your style rules are being overridden. They are cascading stylesheets, after all.

此外,我想指出,您已链接到同一个文件,<$> c $ c> css / style_ipad.css 。

Also I'd like to point out that you've linked to the same file, css/style_ipad.css, in both link tags.

这篇关于CSS样式表,目标iPhone iPad不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆