[英]HTML5 <header> tag not recognised in xhtml file
I am creating a JSF web application and currently formulating a template.xhtml
file. 我正在创建一个JSF Web应用程序,当前正在制定
template.xhtml
文件。 Inside my xhtml file I have created a header and a footer using div elements. 在我的xhtml文件中,我使用div元素创建了页眉和页脚。 However, reading up on HTML5 i understand that you can now use
<header>
and <footer>
tags. 但是,通过阅读HTML5,我了解到您现在可以使用
<header>
和<footer>
标签。
When trying to implement these tags in MyEclipse they show up as "Unknown Tags". 尝试在MyEclipse中实现这些标签时,它们显示为“未知标签”。 I have checked the doctype declaration and it states
<!DOCTYPE html
. 我检查了doctype声明,它声明了
<!DOCTYPE html
。 I was under the assumption that this is all that it needed to support HTML5. 我当时假设这就是支持HTML5所需的全部内容。
My Template.xhtml
file is as follows: 我的
Template.xhtml
文件如下:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ace="http://www.icefaces.org/icefaces/components"
xmlns:icecore="http://www.icefaces.org/icefaces/core"
xmlns:ice="http://www.icesoft.com/icefaces/component"
xml:lang="en" lang="en">
<h:head>
<title><ui:insert name="title"></ui:insert></title>
<link href="#{request.contextPath}/resources/css/Template.css" rel="stylesheet" type="text/css"/>
</h:head>
<h:body>
<header></header>
<div id="header">
<ui:insert name="header">
<h1>OAG Reference Data</h1>
</ui:insert>
</div>
<div id="container">
<ui:insert>
<div id="sidebar">
<ui:insert name="sideBar">
<h:form>
<ace:menu type="sliding" zindex="2">
<ace:submenu label="Carrier">
<ace:menuItem value="General Carrier Data" />
<ace:menuItem value="Contact Info" />
<ace:menuItem value="Alliance Membership" />
</ace:submenu>
</ace:menu>
</h:form>
</ui:insert>
</div>
<div id="content">
<ui:insert name="content">
<h1>Content</h1>
</ui:insert>
</div>
</ui:insert>
</div>
<div id="footer">
<ui:insert name="footer">
<h1>Footer#{bundle['application.defaultpage.footer.content']}</h1>
</ui:insert>
</div>
</h:body>
</html>
I feel that I have misunderstood something along the way. 我觉得我一路上误解了一些东西。 I would appreciate if anyone can clear this up for me.
如果有人能为我解决这个问题,我将不胜感激。
Thanks 谢谢
I have checked the doctype declaration and it states
<!DOCTYPE html
.我检查了doctype声明,它声明了
<!DOCTYPE html
。 I was under the assumption that this is all that it needed to support HTML5.我当时假设这就是支持HTML5所需的全部内容。
If you add the missing character >
, then the assumption is correct. 如果添加缺少的字符
>
,则该假设是正确的。
<!DOCTYPE html>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.