CSS for Mozilla only (including FireFox)

    Layout designers still have the task of connecting styles only for a specific browser. For IE, the problem is solved - few of the typesetters know what conditional comments are . But a vanishingly small number of people know about per-site user stylesheet rules . They are interesting in that Mozilla FireFox will support them through its own rule - “@ -moz-document”.

    In general, this rule allows you to include styles depending on the domain, URL or its prefix. It is important for us that only FireFox will see these rules.

    A simple example of use, from which the general principle becomes clear:

    White in FireFox

    The given example has a drawback - such CSS will not pass validation, which for me personally is not a determining goal, but for many it is like a scout icon.

    The principles of filtering by URL and domain can also be useful, for example, if CSS for several subdomains is loaded from the same address, where all the statics are located. You can read about them, for example, in the W3C archive .

    PS If something is wrong in the article - tell me. This is my first experience.

    The original article is published on my blog .

    Also popular now: