自动完成在Eclipse中的HTML JavaScript jQuery中可用的CSS类 [英] Autocomplete von available CSS classes in HTML JavaScript jQuery in Eclipse

查看:253
本文介绍了自动完成在Eclipse中的HTML JavaScript jQuery中可用的CSS类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用最新的Eclipse版本。现在我用Javascript,jQuery,HTML和CSS进行编码。如何获取自动完成(显示CSS中定义的所有可用类)为CSS中定义的类,以HTML格式显示?



我的CSS文件中有一个名为display的类。



file.css:

  .display {
background:green;
}

如何获取使用自动填充建议的显示类?



HTML:



我需要什么样的插件/插件?

解决方案

默认的WTP插件与Eclipse安装不支持此功能。您将不得不安装扩展插件(


I am using the latest Eclipse version. Right now I am coding with Javascript, jQuery, HTML, and CSS. How do I get autocomplete (show all available classes defined in CSS) for classes, which I have defined in CSS, displayed in HTML?

I have a class called "display" in my CSS file.

file.css:

.display {
background:green;
}

How to get the display class suggested with autocompletion?

HTML:

What kind of plug-in/addon would I need?

解决方案

The default WTP plugin bundled with the Eclipse installation doesn't support this. You will have to install an extension plugin (WTP Web resources).

Go to Help -> Install New Software and add the following URL in the 'Work with' text box and press Add.

http://oss.opensagres.fr/eclipse-wtp-webresources/1.1.0/

After a while, you'll be presented with a check list. Check the plugin and click Install.

After the installation is complete, restart Eclipse. Then open up an HTML file and add a link to a CSS file like in the following example:

sample.html

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>

<link rel="stylesheet" type="text/css" href="test.css" />
</head>
<body >




</body>
</html>

sample.css

.one { padding: 10px; } 
.two { padding: 20px; }

Now add an element within the body of the HTML file - e.g. div - and add a class="" attribute. Pressing Ctrl+Space within the double quotes will bring up the content assist window showing you all the available classes from the linked CSS file.

这篇关于自动完成在Eclipse中的HTML JavaScript jQuery中可用的CSS类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆