使用CSS识别浏览器和操作系统? [英] Identify Browser and OS with CSS?

查看:286
本文介绍了使用CSS识别浏览器和操作系统?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道为特定的浏览器或OS编码特定的CSS是不正确的事情,但是在我正在构建的网站中,某些元素在特定的浏览器中无法很好地呈现。例如,某些元素在IE8中不受支持,或者在小巧的iPhone屏幕上看起来很奇怪。

I know it is not the correct thing to do to code specific CSS for specific Browsers or OS's but in a site I am building there are certain elements which do not render well in specific browsers. For example certain elements are not supported in IE8 or look weird in small iphone display.

因此,我的问题是-仅使用CSS即可识别用户浏览器和操作系统并允许我编码不同的显示选项?

Therefore my question is - using just CSS is it possible to identify the users browser and os and allow me to code different display option?

想要的东西。

推荐答案

可悲的是,我不相信每个系统都可以使用纯CSS。

Sadly I dont believe it possible with just pure css for each system.

但是您可以结合使用CSS和js来查看系统。

However you can use combination of css and js to see system.

请参见此处: http://rafael.adm.br/css_browser_selector/

这篇关于使用CSS识别浏览器和操作系统?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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