Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>To my knowledge, there are no official <em>conditional comments</em> for Firefox. </p> <h2>Possibility #1 - JavaScript</h2> <p>What could be done is using JavaScript to check the browser agent.<br> <strong>Warning:</strong> The browser agent can easily be spoofed. </p> <p><strong>JavaScript</strong></p> <pre><code>function getBrowser() { var browser = navigator.userAgent; if (browser.toLowerCase().indexOf('msie') &gt; -1) return 'ie'; else if (browser.toLowerCase().indexOf('firefox') &gt; -1) return 'firefox'; else return 'mozilla'; } var browser = getBrowser(); if(browser == "ie"){ /* IE code */ } if(browser == "firefox"){ /* Firefox code */ } if(browser == "mozilla"){ /* Other browsers */ /* Chrome, Safari, Opera, etc. */ } </code></pre> <hr> <h2>Possibility #2 - CSS/JavaScript (uses a plugin)</h2> <p>Although this isn't the most optimized way, here is an idea that you could use: </p> <ul> <li><p>Insert this plugin within your page: <a href="http://rafael.adm.br/css_browser_selector/" rel="nofollow noreferrer">http://rafael.adm.br/css_browser_selector/</a>. </p></li> <li><p>Write all the necessary HTML code within different <code>div</code> elements, each with a specific <strong>ID</strong> attribute and all hidden by default (<code>display:none;</code> in CSS). </p></li> <li><p>Use JavaScript to check what color the box is. Depending on the color, show the right <code>div</code> element. You can also remove the hidden <code>div</code> elements. </p></li> <li><p>hide the CSS plugin box or remove it from the DOM.</p></li> </ul> <hr> <h2>Possibility #3 - PHP</h2> <p>Don't think about it. This is a bad practice. You can read why, <a href="https://stackoverflow.com/questions/2199793/php-get-the-browser-name"><strong>here</strong></a>.</p> <hr> <p>I will add more possibilities as they come to my mind. This is a wiki everyone, feel free to add your 2 cents !</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload