开发者

How can I detect if my browser is Firefox? [duplicate]

This question already has answers here: Targeting only Firefox with CSS 开发者_如何学C (13 answers) Closed 7 years ago.

I'm using MVC3 and I would like to set just one single CSS value differently if I am using Firefox. This concerns the paddings on buttons which seems to not be the same across all browsers.

How can I detect if my browser is Firefox.

Hope someone knows the answer.

thanks,


I needed myself a browser detection script, so I found this js script browserDetect.js (Sorry, I didn't find the official project site)

This script let's you manipulate CSS very easily. So if for example you have like:

#my-id
{
  padding: 5px;
}

And in Firefox 4, for instance you want another setting for #my-id, you can do something like this:

.browserFirefox4 #my-id
{
  padding: 10px;
}

And it detects the majority of the browsers.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜