如何将 CSS 自动完成添加到 Eclipse

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7900575/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 20:37:52  来源:igfitidea点击:

How to add CSS autocomplete to eclipse

eclipsejakarta-eeautocomplete

提问by fresh_dev

i am using eclipse helios 3.6and i am developing JSF pages(Dynamic Web Project With JSF Capabilities) and sometimes i need to add style to a component in the xhtml page

我正在使用 eclipse helios 3.6并且我正在开发JSF 页面(具有 JSF 功能的动态 Web 项目),有时我需要向 xhtml 页面中的组件添加样式

<h:commandLink style="margin-righ:10px">

(not a style class) and i want to add CSS autocomplete to eclipse how to do so ? please advise, thanks.

(不是样式类),我想添加 CSS 自动完成功能来使 Eclipse 成为一种方法?请指教,谢谢。

回答by AndroidHustle

Go:

走:

Window -> Preferences -> Web -> CSS files -> Editor -> Content assist.

窗口 -> 首选项 -> Web -> CSS 文件 -> 编辑器 -> 内容辅助。

And make sure the checkboxes are checked

并确保选中复选框

EDIT:Ok... Then try with these:

编辑:好的...然后尝试这些:

Window -> Preferences -> General -> Content Types -> Text -> JSP -> Add (*.css)

Window -> Preferences -> General -> Content Types -> Text -> JSP -> Add (*.css)

OR

或者

Window -> Preferences -> General -> Content Types -> Text -> Java Source File -> Add (*.css)

窗口 -> 首选项 -> 常规 -> 内容类型 -> 文本 -> Java 源文件 -> 添加 (*.css)

Try with these and see if it solves your problem

试试这些,看看它是否能解决你的问题

EDIT 2:Plus try this:

编辑 2:加上试试这个:

Window -> Preferences -> General -> Editors -> File Association -> Add (*.css)

窗口 -> 首选项 -> 常规 -> 编辑器 -> 文件关联 -> 添加 (*.css)

EDIT 3:

编辑 3:

Window -> Preferences -> General -> Editors -> File Association

窗口 -> 首选项 -> 常规 -> 编辑器 -> 文件关联

make sure it looks like this, it works for me with the autocompletion:

确保它看起来像这样,它通过自动完成对我有用:

enter image description here

在此处输入图片说明

回答by spilio

You need to install a WTP extension plugin (WTP Web resources). See my answer here https://stackoverflow.com/a/43549935/2459094.

您需要安装一个 WTP 扩展插件(WTP Web 资源)。在此处查看我的答案https://stackoverflow.com/a/43549935/2459094