Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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,

like image 666
UCC Avatar asked Nov 04 '22 20:11

UCC


1 Answers

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.

like image 76
Andrei Sfat Avatar answered Nov 15 '22 01:11

Andrei Sfat