📜 ⬆️ ⬇️

CSS only for Mozilla (including FireFox)

For designers, there is still a problem - to connect styles only for a specific browser. For IE, the problem is solved - few of the web designers do not know what conditional comments are . But a vanishingly small number of people know about per-site user stylesheet rules . They are interesting because Mozilla FireFox supports them through their own rule - “@ -moz-document”.

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

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

White in FireFox

The above example has a flaw - such CSS will not pass validation, which for me personally is not the defining goal, but for many it is like a scout badge.
')
The principles of filtering by URL and domains can also be useful, for example, if the CSS for several subdomains is loaded from the same address where all the static is located. You can read about them, for example, in the W3C archive .

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

The original article was published on my blog .

Source: https://habr.com/ru/post/21828/


All Articles