Mozilla 도움말 검색

고객 지원 사기를 피하세요. 저희는 여러분께 절대로 전화를 걸거나 문자를 보내거나 개인 정보를 공유하도록 요청하지 않습니다. "악용 사례 신고"옵션을 사용하여 의심스러운 활동을 신고해 주세요.

자세히 살펴보기

CSS styles are only applied, if I change one in the developer tools

  • 2 답장
  • 1 이 문제를 만남
  • 1 보기
  • 최종 답변자: fritzmg

more options

On a particular website we are developing we have a peculiar problem where CSS styles that we change are not applied at all at first (with a cleared cache of course), but only if we disable and then re-enable any CSS style on the site via the inspector in the developer tools.

And in some cases it looks like some CSS styles are sort of "messed up", i.e. there seem to be margins or paddings applied where they shouldn't be. And these problems go away as soon as you open the developer tools (or the inspector in particular).

Furthermore the inspector shows CSS styles that appear to have other CSS selectors as their content (see attached screenshot to see what I mean). While this looks like the underlying stylesheet has syntax errors: the stylesheet is fine and has been validated with https://jigsaw.w3.org/css-validator/ - so that shouldn't be the issue. Besides it works fine in Chrome and Safari.

I am at a loss how I could debug such an issue as I have never seen anything like it before. This only started to happen with FireFox 79.0 so I am wondering if other people have encountered something like this also.

On a particular website we are developing we have a peculiar problem where CSS styles that we change are not applied at all at first (with a cleared cache of course), but only if we disable and then re-enable ''any'' CSS style on the site via the inspector in the developer tools. And in some cases it looks like some CSS styles are sort of "messed up", i.e. there seem to be margins or paddings applied where they shouldn't be. And these problems go away as soon as you open the developer tools (or the inspector in particular). Furthermore the inspector shows CSS styles that appear to have other CSS selectors as their content (see attached screenshot to see what I mean). While this looks like the underlying stylesheet has syntax errors: the stylesheet is fine and has been validated with https://jigsaw.w3.org/css-validator/ - so that shouldn't be the issue. Besides it works fine in Chrome and Safari. I am at a loss how I could debug such an issue as I have never seen anything like it before. This only started to happen with FireFox 79.0 so I am wondering if other people have encountered something like this also.
첨부된 스크린샷

글쓴이 fritzmg 수정일시

모든 댓글 (2)

more options

Firefox 79 is much more aggressive about caching CSS. You may need to Shift+click the Reload button (or use Ctrl+F5) to retrieve updated style sheets. https://wiki.developer.mozilla.org/docs/Mozilla/Firefox/Releases/79#CSS

But if you disabled cache in the dev tools, that shouldn't be an issue?? On other two oddities:

Opening the inspector usually alters the height or width of the viewport, which can trigger repainting. To take that out of the equation, can you "undock" the developer tools to a separate window?

I'm not sure what to make of your screenshot. Could there be some kind of transmission error?

more options

It is definitely not a caching issue. To be sure I always clear the cache completely before refreshing.

It is definitely not about the viewport or the repaint when changing the viewport. I already considered that and tested with an undocked developer tools window on a second screen. The issue disappears as soon as the developer tools are opened. Sometimes the issue even reappears, once the developer tools are closed (though I could not reproduce that reliably yet).

It should not be a transmission error, otherwise I would assume a lot of CSS styles would be broken (well, they are broken, but not really - as the described issues go away once I open the developer tools and/or disable & enable any style). Also these transmission errors would probably manifest in other browsers as well.

Conceivably the issue shown in the screenshot could also be an error in the used sourcemap file - however, since there is no such issue in Chrome/Edge I am assuming that the sourcemap file is valid.