为提升您的使用体验,本站正在维护,部分功能暂时无法使用。如果本站文章无法解决您的问题,您想要向社区提问的话,请到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 提问,我们的支持社区将会很快回复您的疑问。

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

How can I increase the Line Number contrast on (Ctrl-U) Code view?

  • 3 个回答
  • 2 人有此问题
  • 1 次查看
  • 最后回复者为 cor-el

more options

The line number is almost impossible to make out with my 20-20 vision! I have tried other themes (than the default) but these seem to have no effect on the code view. I use the line number to find console-logged errors when debugging on my PHP- and JavaScript-intense website.

Thanks.

The line number is almost impossible to make out with my 20-20 vision! I have tried other themes (than the default) but these seem to have no effect on the code view. I use the line number to find console-logged errors when debugging on my PHP- and JavaScript-intense website. Thanks.

被采纳的解决方案

Hmm. Works for me. I do notice that you didn't include the !important flag. This flag is essential when you want to override and already defined property.

pre[id]:before, span[id]:before { color: #333 !important; }
定位到答案原位置 👍 2

所有回复 (3)

more options

That is not too difficult. The line number is added via a CSS counter that sets the color of the number to a rather faint #ccc value.

  • resource://gre-resources/viewsource.css
pre[id]:before,
span[id]:before {
  content: counter(line) " ";
  counter-increment: line;
  -moz-user-select: none;
  display: inline-block;
  width: 5ch;
  margin: 0 0 0 -5ch;
  text-align: right;
  color: #ccc;
  font-weight: normal;
  font-style: normal;
}

Add code to the userContent.css file.


@-moz-document url-prefix(view-source:){
pre[id]:before, span[id]:before {color: #333 !important}
}

  • create the chrome folder (lowercase) in the <xxxxxxxx>.default profile folder if this folder doesn't exist
  • use a plain text editor like Notepad to create a (new) userContent.css file in the chrome folder (file name is case sensitive)
  • paste the code in the userContent.css file in the editor window
  • make sure that you select "All files" and not "Text files" when you save the file via "Save file as" in the text editor as userContent.css.
    otherwise Windows may add a hidden .txt file extension and you end up with a not working userContent.css.txt file

You can use the button on the "Help -> Troubleshooting Information" (about:support) page to go to the current Firefox profile folder or use the about:profiles page.

more options

No joy. I think I followed the instructions (attached css.jpg), but no change in display (ffx.jpg).

more options

选择的解决方案

Hmm. Works for me. I do notice that you didn't include the !important flag. This flag is essential when you want to override and already defined property.

pre[id]:before, span[id]:before { color: #333 !important; }