IDE:html id 和类参数值中的奇怪颜色
我刚刚开始使用 Netbeans,我喜欢它,但我似乎找不到在哪里更改 html id 和类参数值的字体,而且它目前与我的标签颜色相同,具有随机背景颜色。
我一直在尝试“工具”->“选项”->“字体”->“语法”,但我似乎找不到正确的仪式和调用来更改此设置。
我应该去哪里寻找?
以下是说明该问题的技术读数:
I just started using Netbeans and I love it, but I can't seem to find where to change the font of html id and class parameter values, and its currently the same color as my tags with a random background color.
I've been playing around in Tools->Options->Fonts->Syntax but I can't seem to find the correct rites and invocations to change this.
Where should I be looking?
Here is a technical read out that illustrates the problem:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
class 和 id 属性的值实际上是 CSS 选择器,它具有与普通 HTML 参数值不同的语法突出显示。要修改这些,您应该在字体和字体的语法选项卡中更改级联样式表语言中的选择器类别的值。颜色选项屏幕。
The values for class and id attributes are actually CSS selectors, which have a different syntax highlighting than normal HTML parameter values. To modify these you should alter the value of the Selector category in the Cascading Style Sheets language in the syntax tab of the fonts & colors options screen.
您要查找的内容并不像许多人所说的那样位于“层叠样式表”部分。您要查找的内容位于
字体和颜色
下的HTML
部分。查找HTML 中嵌入的 CSS
。这就是您正在寻找的。希望这有帮助。*我使用的是 Netbeans 7.4
What you are looking for is NOT in the
Cascading Style Sheets
section like many are saying. What your looking for is in theHTML
section under theFonts and colors
. Look forCss Embedded in HTML
. This is what you are looking for. Hope this helps.*I'm using Netbeans 7.4
您可以从选择器下的级联样式表更改颜色,然后重新启动 NetBeans。
You can change the color from cascading style sheets under selector and restart NetBeans.
可以通过字体和字体进行更改颜色选项,然后选择级联样式表类别并在列表中找到“标记出现次数”。从那里,您可以更改该语法的背景和前景色。
Can be changed through the Fonts & Colors options, then select the Cascading Stylesheet category and find "Mark Occurences" on the list. From there, you can change the background and foreground colors for that syntax.
我最近也遇到了同样的问题,实际上没有从其他帖子中找到解决方案,所以我想分享一下我发现的内容。您的问题分为两个子问题(直接引用):
为此,我发现接受的答案和 @user3267044 答案都有效。不过,它们会更改类和 id 的参数,不仅会更改问题中所示的类参数背景颜色
线上应该有警告出现“奇怪”突出显示的地方。就我而言,警告/提示是“缺少 CSS 类”。您可以从编辑器禁用它-->提示(选择 HTML),然后禁用提示“缺少 CSS 类”(或适用于您的情况的提示)
I have recently had the same problem and actually did not find the solution from the other posts, so I thought to share what I found. Your question is broken down in two sub-questions (direct reference):
For that, I found that both the accepted and @user3267044 answers work. They change both class and id's parameters though, not only class parameters background color as shown in your question
There should be a warning on the line where the "weird" highlight appears. In my case, the warning/hint was "Missing CSS class". You can disable it from Editor --> Hints (select HTML) and then disable the hint "Missing CSS class" (or the one that applies to your case)