让 Eclipse 突出显示和验证 HTML 文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6406693/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Getting eclipse to highlight and validate HTML files
提问by ikaushan
How can I configure Eclipse to properly syntax highlight and validate HTML files?
如何配置 Eclipse 以正确地语法突出显示和验证 HTML 文件?
At the moment, Eclipse simply offers spelling suggestions for tags and attributes - an exact opposite of desired behavior.
目前,Eclipse 只是为标签和属性提供拼写建议——与期望的行为完全相反。
回答by Rahul
It is likely that you do not have an HTML editor plugin in Eclipse.
您可能在 Eclipse 中没有 HTML 编辑器插件。
You can download the Web Tools Platformplugin which has a decent HTML editor.
您可以下载Web Tools Platform插件,它有一个不错的 HTML 编辑器。
回答by BZ1
You need the Colorer plugin for Eclipse.
您需要Eclipse的Colorer 插件。
回答by bhagyas
If you have Web Tools Platform already installed, enable validation of HTML files within Eclipse Preferences and make sure you are using the proper eclipse editor.
如果您已经安装了 Web 工具平台,请在 Eclipse 首选项中启用 HTML 文件验证,并确保您使用的是正确的 eclipse 编辑器。
回答by Nathan
I found this to be a difficult thing to figure out. I already had an HTML editor installed as part of Eclipse, but it wasn't getting loaded.
我发现这是一件很难弄清楚的事情。我已经在 Eclipse 中安装了一个 HTML 编辑器,但它没有被加载。
Go to Preferences > General > Editors > File Association and click on *.html (and do the same for *.htm). If you have an HTML editor installed, you should see it in the list. Just click it and then click Default to make Eclipse open HTML files using the HTML editor.
转到首选项 > 常规 > 编辑器 > 文件关联,然后单击 *.html(对 *.htm 执行相同操作)。如果您安装了 HTML 编辑器,您应该会在列表中看到它。只需单击它,然后单击 Default 即可使 Eclipse 使用 HTML 编辑器打开 HTML 文件。
If you don't have an HTML editor installed, WTP is fine, per Rahul's suggestion. You may then need to do the above steps to make sure the HTML Editor is chosen when you edit an HTML file.
如果您没有安装 HTML 编辑器,根据 Rahul 的建议,WTP 很好。然后,您可能需要执行上述步骤以确保在编辑 HTML 文件时选择了 HTML 编辑器。