Browser Detection, do's and don'ts. Is this ok?
Posted
by
JCOC611
on Stack Overflow
See other posts from Stack Overflow
or by JCOC611
Published on 2010-12-24T21:12:25Z
Indexed on
2010/12/24
21:54 UTC
Read the original article
Hit count: 150
So, I understand that browser detection (ie. navigator.userAgent
) shouldn't be used to decide which object method/property to use; yet, I want to set some simple CSS with JavaScript depending on the browser. However, it's not enough to justify a completely new StyleSheet. So is it OK if I use Browser Detection to decide what CSS to apply to an element?
EDIT
Ok, let's be SPECIFIC. I'm talking about a text-shadow
inside a button (<input type="button"/>
) The text inside the button isn't vertically centered in all browsers, so I tweak this with JS depending on the browser.
© Stack Overflow or respective owner