I want to add a specific style to my page but only on firefox running on a pc. I use this code to target just mac but what would be the windows equivalent? and Is there a way to do it with just media querys not javascript?
var FF = !(window.mozInnerScreenX == null);
if(FF) {
if(navigator.platform.indexOf('Mac')>=0)
{
// is a mac and on firefox
}
Method 1: This method uses Mozilla specific extension to add CSS property. This extension supply the CSS property only in Firefox browser. Method 2: The -moz-appearance CSS property is used in Gecko (Firefox) to display an element using platform-native styling based on the operating system's theme.
Firefox DeveloperThe CSS and JavaScript debugging tools are superb, and the Grid tools are unparalleled for coding layouts with CSS Grid.
The @media CSS at-rule can be used to apply part of a style sheet based on the result of one or more media queries. With it, you specify a media query and a block of CSS to apply to the document if and only if the media query matches the device on which the content is being used.
Css hack for firefox
@-moz-document url-prefix() {
.cssSelector {
font-size: 14px;
}
}
Reference
MDN Mozilla CSS Extension you can read all possible CSS extensions for mozilla also you can check this answer
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With