Mozilla 도움말 검색

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

자세히 살펴보기

Alternate Stylesheets in local HTML file?

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

more options

It seems that Firefox on Win10 does not present alternate stylesheets in local files.

See for example: https://www.w3.org/Style/Examples/007/alternatives

I have a trivial HTML file, e.g., c:\alternate_stylesheet.html, with a few of those examples of alternative stylesheets, like:

 <link rel="alternate stylesheet"
       type="text/css"
       href="http://www.w3.org/StyleSheets/Core/Steely" title=Steely>
 <link rel="alternate stylesheet"
       type="text/css"
       href="http://dbaron.org/style/forest" title="Forest (by David Baron)">

Viewing such a trivial HTML page in Firefox on Win10, the View > Page Style list is the default - just "No Style" and "Basic Page Style". The list does not include the head link alternate stylesheet options.

Why not?

IE has no trouble with these (menu View > Style presents them as expected), which seems to confirm that the trivial HTML code is correct.

Any advice?

It seems that Firefox on Win10 does not present alternate stylesheets in local files. See for example: https://www.w3.org/Style/Examples/007/alternatives I have a trivial HTML file, e.g., c:\alternate_stylesheet.html, with a few of those examples of alternative stylesheets, like: <link rel="alternate stylesheet" type="text/css" href="http://www.w3.org/StyleSheets/Core/Steely" title=Steely> <link rel="alternate stylesheet" type="text/css" href="http://dbaron.org/style/forest" title="Forest (by David Baron)"> Viewing such a trivial HTML page in Firefox on Win10, the View > Page Style list is the default - just "No Style" and "Basic Page Style". The list does not include the head link alternate stylesheet options. Why not? IE has no trouble with these (menu View > Style presents them as expected), which seems to confirm that the trivial HTML code is correct. Any advice?

선택된 해결법

Dante said

I at least see a hint that the fix could be released in v78.1.0.

That fix will come in:

  • Regular release channel: Firefox 79.0
  • Extended Support Release (ESR) channel: Firefox 78.1.0esr

But I looked at a locally saved copy of the W3C page in Firefox Developer Edition, which is a beta of Firefox 79, and I don't see the alternate stylesheets listed there. Same with Firefox Nightly, which is an early test version of Firefox 80. So I think you definitely need to file a separate bug about those stylesheets not being listed for pages opened on file:// URLs.

There were some new isolation measures for file:// URLs in recent versions, so it might be a loose end no one noticed when implementing those changes.

문맥에 따라 이 답변을 읽어주세요 👍 1

모든 댓글 (9)

more options

Hmm, the developer tools show that Firefox retrieves the style sheets, so I'm not sure why they aren't exposed on the menu.

You could file a bug:

more options

I can use the Style Editor to disable the default stylesheet and enable one of the other style sheets.

  • https://media.prod.mdn.mozit.cloud/samples/cssref/altstyles/index.html
more options

See also: bug 1645789 - "Basic Page Style" entry in the View > Page Style menu doesn't work reliably

more options

Thanks for the confirmations. But 1645789 may fix this. I'm not quite sure how to read the bug report, but I at least see a hint that the fix could be released in v78.1.0. I'm not "up to date" with 78.0.1.

If v78.1 doesn't fix this for me, I'll submit a new bug report.

Thank you both!

more options

선택된 해결법

Dante said

I at least see a hint that the fix could be released in v78.1.0.

That fix will come in:

  • Regular release channel: Firefox 79.0
  • Extended Support Release (ESR) channel: Firefox 78.1.0esr

But I looked at a locally saved copy of the W3C page in Firefox Developer Edition, which is a beta of Firefox 79, and I don't see the alternate stylesheets listed there. Same with Firefox Nightly, which is an early test version of Firefox 80. So I think you definitely need to file a separate bug about those stylesheets not being listed for pages opened on file:// URLs.

There were some new isolation measures for file:// URLs in recent versions, so it might be a loose end no one noticed when implementing those changes.

more options

Thanks, again. I've done that here:

https://bugzilla.mozilla.org/show_bug.cgi?id=1650603

more options

I did a quick test.
It works in Firefox 66.0.5, but Firefox 67.0.4 is broken.

more options

Note that it is better to attach a test file instead of pasting the code in a reply and even then you can use markup code (indent with four spaces or use backticks `code` or three backticks to enclose a block).

```
code
```

글쓴이 cor-el 수정일시

more options

thanks for the clear guidance. much appreciated, as this is new territory for me.