是否有可能有单独的CSS样式表自动加载取决于什么浏览器的网站被访问? [英] Is it possible to have separate css stylesheets that are automatically loaded depending on what browser the website is being accessed from?

查看:106
本文介绍了是否有可能有单独的CSS样式表自动加载取决于什么浏览器的网站被访问?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我问的原因是因为我完成了一个可爱的主页设计,只查看了网站的chrome和safari的osx然后我决定打开firefox和某些事情打破了。

The reason I'm asking is because I finished a lovely homepage design and only viewed the website in chrome and safari on osx then I decided to open firefox and certain things broke.

还有一个问题,我与搜索字段占位符文本显示错误的颜色已消失,并显示正确的颜色,我在我的样式表在firefox中陈述。

Also an issue I was having with search field placeholder text displaying wrong colour had vanished and displayed the correct colour I stated in my stylesheet in firefox.

如果我可以为不同的浏览器创建单独的样式表,或者有条件语句,将根据浏览器触发正确的设置。

It would be great if I could just create separate style sheets for different browsers or have conditional statements that would trigger the correct settings depending on the browser.

也是一个伟大的工具,查看我的网站在多个浏览器手动将是伟大的。

Also a great tool for viewing my site in multiple browsers manually would be great.

推荐答案

由于通常问题是与IEs有关,所以有一个解决方案。

下一行

Since usually the problems are with IEs, there is a solution for that.
The next line, which you can put inside the head tags, will loads a specific CSS only if you use IE7

<!--[if IE 7]>
    <link rel="stylesheet" type="text/css" href="http://your.css/my.css" />
<![endif]-->

其他IE使用相同的方法。

Same approach for other IEs.

这篇关于是否有可能有单独的CSS样式表自动加载取决于什么浏览器的网站被访问?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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