在Eclipse中警告有效的HTML5属性 [英] Warnings of valid HTML5 attributes in Eclipse

查看:164
本文介绍了在Eclipse中警告有效的HTML5属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Eclipse,我用HTML5内容编写jsp文件。
所以我举个例子:

 < div class =testdata-role =test123 > 

在Eclipse中,我收到警告:

 未定义的属性名称(数据角色)

需要什么要做到这些警告不会再出现了?在HTML5中,您可以在此处看到属性(data- *): http:/ /ejohn.org/blog/html-5-data-attributes/



最好的问候。

解决方案

您的doctype





适用于HTML 4.01。 / p>

data- *属性已添加到HTML 5. HTML 5的doctype基本上是

 <!DOCTYPE html SYSTEM关于:legacy-compat> 

 <!DOCTYPE html> 


I use Eclipse and I write jsp files with HTML5 content. So I have for example this line:

<div class="test" data-role="test123">

In Eclipse I get the warning:

Undefined attribute name (data-role)

What needed to be done so these warnings won't appear anymore? In HTML5 this attribute is allowed (data-*) as you can see here: http://ejohn.org/blog/html-5-data-attributes/

Best Regards.

解决方案

Your doctype

is for HTML 4.01.

data-* attributes were added in HTML 5. The doctype for HTML 5 is basically either

<!DOCTYPE html SYSTEM "about:legacy-compat">

or

<!DOCTYPE html>

这篇关于在Eclipse中警告有效的HTML5属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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