我在哪里可以找到示例XHTML5源代码? [英] Where can I find sample XHTML5 source codes?

查看:121
本文介绍了我在哪里可以找到示例XHTML5源代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在哪里可以找到样本 X HTML 5网页?我主要想知道是否可以将XHTML 5与其他XML语言(如XHTML 1)混合搭配使用。比如像这样在XHTML 5中有效吗?

 <!DOCTYPE html PUBLIC什么时候应该在这里? 
应该在哪里?>
xmlns:ui =http://java.sun.com/jsf/facelets>
< head>
< title>< ui:insert name =title>默认标题< / ui:insert>< / title>
< link rel =stylesheettype =text / csshref =./ css / main.css/>
< / head>

< body>

< div id =header>
< ui:insert name =header>
< ui:include src =header.xhtml/>
< / ui:insert>
< / div>


< div id =left>
< ui:insert name =navigation>
< ui:include src =navigation.xhtml/>
< / ui:insert>
< / div>


< div id =center>
< br />
< span class =titleText> < ui:insert name =title/> < /跨度>
< hr />
< ui:insert name =content>
< div>
< ui:include src =content.xhtml/>
< / div>
< / ui:insert>
< / div>

< div id =right>
< ui:insert name =news>
< ui:include src =news.xhtml/>
< / ui:insert>
< / div>

< div id =footer>
< ui:insert name =footer>
< ui:include src =footer.xhtml/>
< / ui:insert>
< / div>

< / body>

< / html>

预先致谢。

解决方案

你根本不需要文档类型。它们不是为了处理命名空间而设计的,并且不能用于XML中的任何有用的目的。 (在HTML中,它们是进入标准模式所必需的)。如果你真的坚持要有一个,无论出于何种原因,只需使用<!DOCTYPE html> p>

至于命名空间:

 < html xmlns =http: //www.w3.org/1999/xhtml
xmlns:ui =http://java.sun.com/jsf/facelets>

您已经在使用,我假设。

正如你所看到的,没有关于你使用的版本的信息。那是因为你不需要它。对于验证,您可以在用户界面中选择目标,浏览器从未查看过版本。也就是说,在浏览器中,不存在HTML3.2或HTML4.01或HTML5,只有HTML,没有XHTML1.0,XHTML1.1或XHTML5,只有XHTML。今天,这些主要由HTML4.01 / XHTML1.0和HTML5的一些部分以及一些专有部分组成(尽管HTML5已经指定了其中的大部分)。


Where can I find sample XHTML 5 pages? I mainly want to know if it is possible to mix and match XHTML 5 with other XML languages just like XHTML 1 or not. For example is something like this valid in XHTML 5?

<!DOCTYPE html PUBLIC "WHAT SHOULD BE HERE?" 
          "WHAT SHOULD BE HERE?">
<html xmlns="WHAT SHOULD BE HERE?"
      xmlns:ui="http://java.sun.com/jsf/facelets">
<head>
  <title><ui:insert name="title">Default title</ui:insert></title>
  <link rel="stylesheet" type="text/css" href="./css/main.css"/>
</head>

<body>

<div id="header">
    <ui:insert name="header">
        <ui:include src="header.xhtml"/>
    </ui:insert>
</div>


<div id="left">
  <ui:insert name="navigation" >
    <ui:include src="navigation.xhtml"/>
  </ui:insert>
</div>


<div id="center">
  <br />
  <span class="titleText"> <ui:insert name="title" /> </span>
  <hr />
  <ui:insert name="content">
    <div>
    <ui:include src="content.xhtml"/>  
    </div>
  </ui:insert>
</div>

<div id="right">
  <ui:insert name="news">
    <ui:include src="news.xhtml"/>
  </ui:insert>
</div>

<div id="footer">
  <ui:insert name="footer">
    <ui:include src="footer.xhtml"/>  
  </ui:insert>
</div>

</body>

</html>

Thanks in advance.

解决方案

You don't need a doctype at all. They are not designed to cope with namespaces and don't serve any useful purpose in XML. (In HTML, they are necessary to get into standards mode.) If you really insist on having one, for whatever reason, use simply <!DOCTYPE html>.

As for the namespace:

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets">

as you are already using, I assume.

As you see, there is no information about the version you're using. That's because you don't need it. For validation, you can pick your target in the UI, and browsers have never looked at versions. That is, in browsers, there is no such thing as HTML3.2 or HTML4.01 or HTML5, just "HTML", and no XHTML1.0, XHTML1.1 or XHTML5, only "XHTML". Today, those consist mainly of HTML4.01/XHTML1.0 and some parts of HTML5, as well as some proprietary parts (though HTML5 has specified most of these).

这篇关于我在哪里可以找到示例XHTML5源代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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