5

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,

UCC
  • 53
  • 1
  • 3

1 Answers1

2

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.

Andrei Sfat
  • 8,440
  • 5
  • 49
  • 69