AI编程助手
AI免费问答

html6的展望与代码

零下一度   2017-05-02 15:28   3203浏览 原创

       html5 是 html 语言最受欢迎的版本之一,它支持音频和视频、离线存储、移动端、和标签属性等等。还提供了

这样的标签来帮助开发者更好地组织页面内容。然而 html5 规范仍然没有最后定稿,并且它并不是一个真正意义上的语义标记语言。

HTML6 展望

       你有没有曾经希望能在 HTML 中使用自定义标签?比如:使用来显示你的网站logo,还有使用来显示工具栏等等。我们经常使用

来组织页面,在 HTML6 里我们希望可以直接使用象这样的自定义标签。

HTML6 代码样例:

nbsp;html>
 <html>
 <head>
 <title>A Look Into HTML6</title>
 <meta>
</head>
 <body>
 <header>
 <logo>
 <media>
 </media></logo>
 <nav>
 <a>a1
 <a>a2
 </a></a></nav>
 </header>
 <content>
 <article>
 <h1>Heading of main article</h1>
 <h2>Sub-heading of main article</h2>
 <p>[...]</p>
 <p>[...]</p>
 </article>
 <article>
 <h1>The concept of HTML6</h1>
 <h2>Understanding the basics</h2>
 <p>[...]</p>
 </article>
 </content>
 <footer>
 <copyright>This site is © to Anonymous 2014</copyright>
 </footer>
 </body>
 </html>


       在上面的代码中,你也许注意到了一些奇怪的标签,它们是 W3C 和 HTML6 规范中在命名空间里定义的标签。例如:负责设定你浏览器的标题栏文字,<media>负责显示图片等等。用户可以自己定义标签以便 JavaScript 和 CSS 识别和处理,这样页面代码会更易读,语义更清晰。<br></media>

HTML6 APIs

       HTML6 的标签前带有命名空间,如:, 等等。
 
1. 

nbsp;html>

 <html>// this is equivalent to  tag written in previous HTML versions

 <!-- sample of HTML document -->

 </html>

2.  和  标签一样。

nbsp;html>

 <html>

 <head>

 <!-- Main content would come here, like the <html:title> tag -->

 </head>

 </html>

3.  和 <title> 标签类似。<br>

nbsp;html>

 <html>

 <head>

 <title>A Look Into HTML6</title>

 </head>

 </html>

4. <meta>

nbsp;html>

 <html>

 <head>

 <title>A Look Into HTML6</title>

 <meta>
</head>

 </html>

5. 

nbsp;html>

 <html>

 <head>

 <title>A Look Into HTML6</title>

 <link>
</head>

 </html>

6.  和  标签一样。

nbsp;html>

 <html>

 <head>

 <title>A Look Into HTML6</title>

 </head>

 <body>

 <!-- This is where your website content is placed -->

 </body>

 </html>

7.  和  标签类似,区别是  只有 “href” 一个属性。

nbsp;html>

 <html>

 <head>

 <title>A Look Into HTML6</title>

 </head>

 <body>

 <a>Go to siteurl.com!</a>

 </body>

 </html>

8.  和 

nbsp;html>

 <html>

 <head>

 <title>A Look Into HTML6</title>

 </head>

 <body>

 <button>Click Here</button>

 </body>

 </html>

9.  涵盖 

nbsp;html>

 <html>

 <head>

 <title>A Look Into HTML6</title>

 </head>

 <body>

 <!-- Image would come here -->

 <media>

 <!-- Video doesn&#39;t need a type -->

 <media>

 </media></media>
</body>

 </html>

标签类型(Tag types)概述

和 HTML5 一样, HTML6 也有两种标签类型:单标签(single tag) 和双标签(double tag)

<meta>

单标签不需要结束符’/’

结语

HTML6 规范还未发布,本文原作者Oscar Godson 只是为我们提供了一个对 HTML6 规范的展望,或者说他希望 HTML6 能够支持的一些新特性。

前端入门到VUE实战笔记:立即学习
>在学习笔记中,你将探索 前端 的入门与实战技巧!

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。