是否可以使用纯CSS检测Firefox用户?
问题描述:
是否可以仅使用IE之类的CSS来检测Firefox浏览器?
Is it possible to detect Firefox Browser only with CSS like IE?
例如,可以使用以下方式检测IE浏览器:
for example, IE browser can be detected like:
<!--[if IE 7]>
/* IMPORTING CSS FOR IE */
<![endif]-->
可以像这样的代码检测到Firefox浏览器吗?
Can be Firefox browser detected like this code?
答
我不知道,但是您可以尝试以下方法:
Not that I know of, but you can try this:
@-moz-document url-prefix() {
#my-id { font-size: 100%; }
}
此网站也有更多选择
您可以将其放置在CSS文件中或HTML的< style type ='text / css'>
标记之间。效果很好!
You can place this in your CSS file or between your <style type='text/css'>
tags in your HTML. Works Fine!