我想对所有输入框、文本框和选择框应用时尚主题,所以我写道:
@namespace url(http://www.w3.org/1999/xhtml);
textarea, input, select {
background-color: white !important;
color: black !important;
}
我的理解是,这将仅适用于网页,但它也会影响 URL 栏,使其变白。有没有办法让它不影响 URL 栏?
我正在使用 Firefox Nightly(版本 43)。
更新
如果你想让 GTK3 Firefox 在深色主题下看起来不错,最终的解决方案是一个时尚的配置:
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document url-prefix('http://'), url-prefix('https://') {
textarea, input, select {
background-color: white !important;
color: black !important;
}
}
像魅力一样工作。
最佳答案
Firefox 在其 chrome 中混合使用 XUL 和 HTML,因此声明默认 CSS namespace 也会影响浏览器 chrome 中的 HTML 元素。您可以将样式包装在 @-moz-document
block 中以限制目标内容的来源,例如:
@-moz-document url-prefix('http://'), url-prefix('https://') { /* your code here */}
关于css - 将时尚应用于所有网站,但不适用于浏览器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33130777/