Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

css media query that targets firefox pc only

Tags:

html

css

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
         }
like image 730
nick Avatar asked Aug 12 '14 15:08

nick


People also ask

How do I only write CSS in 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.

Is Firefox better for CSS?

Firefox DeveloperThe CSS and JavaScript debugging tools are superb, and the Grid tools are unparalleled for coding layouts with CSS Grid.

What does @media only screen mean in CSS?

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.


2 Answers

Css hack for firefox

@-moz-document url-prefix() { 
  .cssSelector {
     font-size: 14px;
  }
}

Reference

like image 142
Benjamin Avatar answered Nov 13 '22 09:11

Benjamin


MDN Mozilla CSS Extension you can read all possible CSS extensions for mozilla also you can check this answer

like image 40
oqx Avatar answered Nov 13 '22 08:11

oqx