I know there is an IF STATMENT for IE but can somebody tell me the if statment for Firefox? Like for IE : <!--[if IE]> <link type="text/css" rel="stylesheet" href="iestyles.css"> <![endif]--> how is for Firefox?
<!--[if IE]> <link type="text/css" rel="stylesheet" href="iestyles.css"> document.getElementById("txt").innerHTML="" <![endif]--> <span id="txt"> <link type="text/css" rel="stylesheet" href="ffstyles.css"> </span> Code (markup): Tell me how that works for you
I'm afraid that wouldn't work all that well. For example, my own version of Firefox has been re-branded as Iceweasel. What about other re-branded and modified versions, e.g. Flock or Epiphany, &c.. My browser's id string looks like this: See PPK's browser detect article and script for the straight poop on the methods and issues of browser detection. cheers, gary
Quite frankly, you shouldn't need or be using either. If you are needing to send Firefox specific code, it probably means both your HTML and CSS are the WRONG HTML/CSS or the methodology in creating the page is completely broken. But then, I've never once had to resort to IE conditionals for CSS, (I did ONCE for javascript out of expediency) and cannot imagine what you need to do that would warrant it for firefox - since that probably ALSO means the page is broken in Safari and Opera. Rather than WASTE YOUR TIME with HTML conditional asshattery, could you post a link to the offending page so we can tell you what you are doing wrong in the first place? Twelve to one you are lacking a doctype, lacking a CSS reset, don't trip haslayout for IE where appropriate, declaring paddings and width at the same time, are using nonsense like 'clearfix', and lack semantic markup with separation of presentation from content.