How to correctly redefine the CSS settings for FireFox?


Tags: html,css,html5,css3,xhtml

Problem :

I have the following problem with CSS.

I have to define this style that have to be applied only if the used browser is **FireFox)

body {
    text-align: center;
    background-color: #E9FDE9;
    color: #696969;
    size: 12px;
}

So the CSS setting for the body tag have to be redifined only if the browser is FireFox.

I know that for IE I can use the conditional comment...but for FireFox?



Solution :

This will do the trick:

    @-moz-document url-prefix() { 
       body {
         text-align: center;
         background-color: #E9FDE9;
         color: #696969;
         size: 12px;
       }
   }

    CSS Howto..

    How Can I get my DL to style properly?

    Make image show when screen reaches a certain width (pixels)

    How to show borders of th elements with gradient fills in IE9?

    HTML/CSS - How do I make divs to size according to their contents?

    How do I add a special CSS class to run only on IE for a div component?

    how to make content to be fixed inside scroll div using only css?

    How to pass an array from controller to PHP file that contains CSS before the view is loaded?

    How to stop Injected HTML-div / CSS from inheriting styles ? (Internet Explorer)

    (some) background images won't show up in IE7 or IE8

    How to flow text from a box to another with CSS

    CSS background color show another color

    How to insert background image on HTML Tag using css?

    How to center a text line in a navigation bar?

    How to Bring a h1 to top of the div?

    How To Outline a PNG (Transparent) image with CSS?

    How to put CSS and HTML in one page of code? [duplicate]

    How to prevent division when using variables separated by a slash in CSS property values

    How to position an element at the TOP LEFT corner of a page using CSS?

    How can I make a div 100% of the browser window height, but with a top and bottom margin?

    Floating divs, different height, building from left to right. how to fill vertical gaps between levels?

    how to move scrollbar from left to right in css?

    How to remove css : hover using jquery?

    How To Style A Class Based On Unique ID?

    How to put a ribbon image on another image with css?

    How to change CSS with jQuery change and this

    How to display random parts of a page on refresh?

    how can I center the image in my div? (so far the left border of my img is centered)

    How to add strped tabs on Ionic css

    how to position an “Insert row” button in front of each horizontal row border of a table?

    How to change CSS (background-image) from JQuery in Rails?