Search code examples
cssfirefoxmozilla

mozilla, trouble changing first css style with 2nd new style


This is a pretty basic page, but I'm having issues with it displaying properly in Mozilla/Firefox. Works fine in Chrome and IE.

It's a php page, which I don't believe is the issue. The page has a primary style sheet for the overall site which is main.css, and a sub-style page which loads 2nd and should overwrite what I need/want changed called adv.css FF doesn't seem to want to read adv.css

Thanks in advance!


Solution

  • Based on the comments, it sounds like it was a caching problem. Here's a little trick you can use to avoid caching, using PHP:

    <link rel="stylesheet" type="text/css" href="../css/adv.css?v=<?php echo date("Ymd.H.i.s", filemtime("/css/adv.css")); ?>" />
    

    That way, every time you make a modification to your CSS, you'll get an automatic new version on your CSS file(s).

    Edit: As Mike suggests in the comments, an even better way would be to disable cache while dev tools are open.

    To do this on Chrome or Firefox:

    1. Hit F12
    2. Click the little gear for Settings
      • (Chrome) In the General tab, check the "Disable cache (while DevTools is open)"
      • (Firefox) In the Advanced Settings, check the "Disable Cache (when toolbox is open)"