Trang web này sẽ có chức năng hạn chế trong khi chúng tôi trải qua bảo trì để cải thiện trải nghiệm của bạn. Nếu một bài viết không giải quyết được vấn đề của bạn và bạn muốn đặt câu hỏi, chúng tôi có cộng đồng hỗ trợ của chúng tôi đang chờ để giúp bạn tại @FirefoxSupport trên Twitter và /r/firefox trên Reddit.

Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Tìm hiểu thêm

Does userContent.css require a header? knowledge base doesn't say

  • 2 trả lời
  • 1 gặp vấn đề này
  • 3 lượt xem
  • Trả lời mới nhất được viết bởi cor-el

more options

Hi,

Since many User Styles aren't working, I'm using userChrome.css, and I'm trying to use userContent.css. It's not working.

http://kb.mozillazine.org/index.php?title=UserContent.css&printable=yes doesn't explain how to write userContent.css to get it to work. It asks people to download a zip file instead of explaining how to write the thing.

http://kb.mozillazine.org/Editing_configuration/Manual_editing doesn't explain it either

http://kb.mozillazine.org/Editing_configuration/Troubleshooting doesn't explain it either

If it does require a header, what is that header? I've used the same header as for userChrome:

@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);

Hi, Since many User Styles aren't working, I'm using userChrome.css, and I'm trying to use userContent.css. It's not working. http://kb.mozillazine.org/index.php?title=UserContent.css&printable=yes doesn't explain how to write userContent.css to get it to work. It asks people to download a zip file instead of explaining how to write the thing. http://kb.mozillazine.org/Editing_configuration/Manual_editing doesn't explain it either http://kb.mozillazine.org/Editing_configuration/Troubleshooting doesn't explain it either If it does require a header, what is that header? I've used the same header as for userChrome: @namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);

Tất cả các câu trả lời (2)

more options

Don't use the "XUL" header in userContent.css -- XUL is a language used only in the user interface.

(I don't use it in userChrome.css either, but it's slightly controversial. https://www.userchrome.org/adding-style-recipes-userchrome-css....)

You can optionally use an HTML namespace header in userContent.css, but it shouldn't make any difference. There must be some other issue.

  • Name -- as with userChrome.css, the file name of userContent.css must match exactly
  • Location -- same chrome folder as userChrome.css

Now, as for the specific user styles, if they don't work in Stylus perhaps they just don't work??

The only reason to use a userContent.css file instead of Stylus, in my opinion, is to modify internal Firefox pages like the Add-ons page or new tab page. For regular web pages, it's easier to use Stylus.

more options

userChrome.css is for making changes to the Firefox user interface. For some (html namespace) elements you sometimes need to override the default XUL name space (*|<element>). userContent.css is for styling web pages and doesn't need a @namespace header or it would be the default HTML namespace.

@namespace url(http://www.w3.org/1999/xhtml);

Both files support @-moz-document rules to limit the rules to a specific domain or URL.