–lang 谷歌浏览器_浏览HTML6 –它是什么以及它必须提供什么?

–lang 谷歌浏览器

HTML6 overview. HTML is a simple web development language that keeps on rolling out new versions, and has started working on its sixth revision. HTML5 the current revision of HTML is considered to be one of the most sought-after revisions, compared to all the previous HTML versions.

HTML6概述。 HTML是一种简单的Web开发语言,一直在推出新版本,并已开始进行第六版修订。 与所有以前HTML版本相比,HTML5当前HTML版本被认为是最受欢迎的版本之一。

让我们来概述一下HTML5 (Let’s have an Overview of HTML5)

HTML5 gave us some very exciting features like audio and video support, offline local storage, and most importantly ability to build mobile optimized websites. In addition, it gave us freedom from using type attribute from tags such as <link> and <script>. What’s more? It helped developers organize content in a more relevant manner using new tags like <article>, <section>, <header> etc. However, HTML5 is still in its development stage and isn’t a truly semantic markup.

HTML5为我们提供了一些非常令人兴奋的功能,例如音频和视频支持,脱机本地存储以及最重要的是构建移动优化网站的功能。 此外,它使我们可以自由使用<link><script>类的标记中的type属性。 更重要的是? 它使用<article><section><header>等新标签帮助开发人员以更相关的方式组织内容。但是,HTML5仍处于开发阶段,并不是真正的语义标记。

了解HTML6的概念 (Understanding the Concept of HTML6)

Have you ever wondered if you could express tags? If you haven’t then, just imagine using tags like <logo></logo> for assigning a logo to your web page, or using tag <toolbar></toolbar> and so on. Wouldn’t it be better if your could use the <div> tag without using multiple id’s such as a wrapper or container, and rather use <wrapper> or a <container> directly. Simply put, instead of using <div id='container'> you can simply use <container>. This is where HTML6 comes in.

您是否想过可以表达标签吗? 如果还没有,那么可以想象使用<logo></logo>的标签为您的网页分配徽标,或者使用<toolbar></toolbar>等标签。 如果您可以在不使用多个ID(例如包装器或容器)的情况下使用<div>标记,而不直接使用<wrapper><container> ,那会更好。 简而言之,代替使用<div id='container'>您可以简单地使用<container> 。 这就是HTML6出现的地方。

HTML6 is sixth revision of HTML with namespaces that has structure like XML. XML namespaces will help you use the same tag without conflicting it with any other tag. For instance the one used in the XHTML DOCTYPE:

HTML6是HTML的第六版,其命名空间具有类似于XML的结构。 XML名称空间将帮助您使用相同的标签,而不会与其他任何标签冲突。 例如,在XHTML DOCTYPE中使用的一个:


xmlns:xhtml="http://www.w3.org/1999/xhtml"

xmlns:xhtml="http://www.w3.org/1999/xhtml"

HTML6 will provide us the benefit to use tags that we want and won’t have to use only the defined tags.

HTML6将为我们提供使用所需标签的好处,而不必仅使用定义的标签。

HTML6范例 (Example of HTML6)

<!DOCTYPE html>
<html:html>
    <html:head>
        <html:title>A Look Into HTML6</html:title>
        <html:meta type="title" value="Page Title">
        <html:meta type="description" value="HTML example with namespaces">
        <html:link src="css/mainfile.css" title="Styles" type="text/css">
        <html:link src="js/mainfile.js" title="Script" type="text/javascript">
    </html:head>
    <html:body>
        <header>
            <logo>
                <html:media type="image" src="images/xyz.png">
            </logo>
            <nav>
               <html:a href="/img1">a1</a>
               <html:a href="/img2">a2</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 &copy; to Anonymous 2014</copyright>
        </footer>
    </html:body>
</html:html>

<!DOCTYPE html>
<html:html>
    <html:head>
        <html:title>A Look Into HTML6</html:title>
        <html:meta type="title" value="Page Title">
        <html:meta type="description" value="HTML example with namespaces">
        <html:link src="css/mainfile.css" title="Styles" type="text/css">
        <html:link src="js/mainfile.js" title="Script" type="text/javascript">
    </html:head>
    <html:body>
        <header>
            <logo>
                <html:media type="image" src="images/xyz.png">
            </logo>
            <nav>
               <html:a href="/img1">a1</a>
               <html:a href="/img2">a2</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 &copy; to Anonymous 2014</copyright>
        </footer>
    </html:body>
</html:html>

Looking at the above HTML6 document you’ll see some odd <html:x> tags. Those odd tags are the namespaced elements that belong to the W3C and HTML6 spec, and will trigger browser events. For example, the <html:title> element will change the title bar of your browser and the <html:media> element will help make the defined image appear on your browser screen. The best part is that all these elements are specifically defined for users and don’t have anything to do with the browser. They’re nothing more than hooks for JavaScript and style sheet and helps to make your sample code more semantic.

查看上面HTML6文档,您会看到一些奇怪的<html:x>标签。 这些奇数标记是属于W3C和HTML6规范的命名空间元素,将触发浏览器事件。 例如, <html:title>元素将更改浏览器的标题栏,而<html:media>元素将帮助使已定义的图像出现在浏览器屏幕上。 最好的部分是所有这些元素都是专门为用户定义的,与浏览器没有任何关系。 它们不过是JavaScript和样式表的钩子,有助于使示例代码更具语义。

HTML6 API (HTML6 APIs)

The HTML6 tags will have the namespace html like <html:html> or <html: head> etc. Let’s have a look at the each tag attributes used in the above HTML6 example document.

HTML6标签将具有名称空间html,如<html:html><html: head>等。让我们看一下上述HTML6示例文档中使用的每个标签属性。

1. <html:html> (1. <html:html>)

<!DOCTYPE html>
<html:html>// this is equivalent to <html> tag written in previous HTML versions
  <!-- sample of HTML document -->
</html:html>

<!DOCTYPE html>
<html:html>// this is equivalent to <html> tag written in previous HTML versions
  <!-- sample of HTML document -->
</html:html>

2. <html:head> (2. <html:head>)

This tag is equivalent to <head> tag. It’s purpose is to obtain data and scripts that tweaks how the content is displayed within the <html:body> tag.

该标签等效于<head>标签。 目的是获取可调整<html:body>标记内内容显示方式的数据和脚本。


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

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

3. <html:title> (3. <html:title>)

As the name implies, it will change the title of the HTML document, and is similar to the <title> tag used in earlier HTML versions. This tag is used by browsers for changing the title bar, favorites, etc.

顾名思义,它将更改HTML文档的标题,类似于早期HTML版本中使用的<title>标签。 浏览器使用此标签来更改标题栏,收藏夹等。


<!DOCTYPE html>
<html:html>
  <html:head>
    <html:title>A Look Into HTML6</html:title>
  </html:head>
</html:html>

<!DOCTYPE html>
<html:html>
  <html:head>
    <html:title>A Look Into HTML6</html:title>
  </html:head>
</html:html>

4. <html:meta> (4. <html:meta>)

This tag is somewhat different from the <meta> tag used in the latest HTML version. Using this HTML6 tag you can use any sort of meta data. And so, unlike HTML5 you won’t have to use the standard meta types in HTML6. It helps to accumulate information such as a webpage description, by storing content.

此标记与最新HTML版本中使用的<meta>标记有些不同。 使用此HTML6标签,您可以使用任何类型的元数据。 因此,与HTML5不同,您不必在HTML6中使用标准元类型。 通过存储内容,它有助于积累诸如网页描述之类的信息。


<!DOCTYPE html>
<html:html>
  <html:head>
    <html:title>A Look Into HTML6</html:title>
    <html:meta type="description" value="HTML example with namespaces">
  </html:head>
</html:html>

<!DOCTYPE html>
<html:html>
  <html:head>
    <html:title>A Look Into HTML6</html:title>
    <html:meta type="description" value="HTML example with namespaces">
  </html:head>
</html:html>

5. <html:link> (5. <html:link>)

This tag will help you link external documents and scripts (like CSS, JS etc.) to the HTML document. It’s similar to <link> tag used in HTML5. This tag includes following attributes:

此标记将帮助您将外部文档和脚本(如CSS,JS等)链接到HTML文档。 它类似于HTML5中使用的<link>标记。 该标签包括以下属性:

  • charset: "UTF-8" character encoding.

    字符集:“ UTF-8”字符编码。
  • href: It contains link to your source file.

    href:它包含指向您的源文件的链接。
  • media: This defines the kind of device on which your item will run, for example, "Smartphone" or "tablet".

    媒体:这定义了您的商品将在其上运行的设备的类型,例如“智能手机”或“平板电脑”。
  • type: The MIME type of the document.

    type:文档的MIME类型。

<!DOCTYPE html>
<html:html>
  <html:head>
    <html:title>A Look Into HTML6</html:title>
 <html:link src="js/mainfile.js" title="Script" type="text/javascript">
  </html:head>
</html:html>

<!DOCTYPE html>
<html:html>
  <html:head>
    <html:title>A Look Into HTML6</html:title>
 <html:link src="js/mainfile.js" title="Script" type="text/javascript">
  </html:head>
</html:html>

6. <html:body> (6. <html:body>)

This is just like the <body> tag that you’ve been using in the current HTML version. This is where all your website stuff like text, media and others are placed.

就像您在当前HTML版本中一直使用的<body>标记一样。 这是您所有网站内容(例如文本,媒体等)的放置位置。


<!DOCTYPE html>
<html:html>
  <html:head>
    <html:title>A Look Into HTML6</html:title>
  </html:head>
  <html:body>
    <!-- This is where your website content is placed -->
  </html:body>
</html:html>

<!DOCTYPE html>
<html:html>
  <html:head>
    <html:title>A Look Into HTML6</html:title>
  </html:head>
  <html:body>
    <!-- This is where your website content is placed -->
  </html:body>
</html:html>

7. <html:a> (7. <html:a>)

This tag is similar to the <a> tag, and is used to represent a link to other web page. However, unlike the <a> tag, <html:a> takes only a single ‘href’ attribute, which directs the link to the page you need to visit.

此标签类似于<a>标签,用于表示到其他网页的链接。 但是,与<a>标记不同, <html:a>仅采用单个“ href”属性,该属性将链接定向到您需要访问的页面。


<!DOCTYPE html>
<html:html>
  <html:head>
    <html:title>A Look Into HTML6</html:title>
  </html:head>
  <html:body>
    <html:a href="http://siteurl">Go to siteurl.com!</html:a>
  </html:body>
</html:html>

<!DOCTYPE html>
<html:html>
  <html:head>
    <html:title>A Look Into HTML6</html:title>
  </html:head>
  <html:body>
    <html:a href="http://siteurl">Go to siteurl.com!</html:a>
  </html:body>
</html:html>

8. <html:button> (8. <html:button>)

This tag is equivalent to <button> tag or <input type="button"> used in the current and older HTML versions. This tag enables you to create a button to help a user perform some interaction on your site’s page. It has one attribute disabled.

此标记等效于当前和较旧HTML版本中使用的<button>标记或<input type="button"> 。 使用此标记,您可以创建一个按钮来帮助用户在您的网站页面上执行某些交互。 它禁用了一个属性。


<!DOCTYPE html>
<html:html>
  <html:head>
    <html:title>A Look Into HTML6</html:title>
  </html:head>
  <html:body>
    <html:button>Click Here</html:button>
  </html:body>
</html:html>

<!DOCTYPE html>
<html:html>
  <html:head>
    <html:title>A Look Into HTML6</html:title>
  </html:head>
  <html:body>
    <html:button>Click Here</html:button>
  </html:body>
</html:html>

9. <html:media> (9. <html:media>)

This tag wrap up all the <media> tags like <img>, <video>, <embed>, etc. By using <html:media> tag, you no longer have to specify a tag for each of the file type. The <html:media> tag you’re using will be executed by the browser based on the type attribute (if provided), or it will just make a guess on the basis of file extension, or by the ‘MIME type’.

该标签包裹了所有<media>标签,例如<img><video><embed>等。通过使用<html:media>标签,您不再需要为每种文件类型指定标签。 您正在使用的<html:media>标记将由浏览器根据type属性(如果提供)执行,或者仅根据文件扩展名或'MIME type'进行猜测。


<!DOCTYPE html>
<html:html>
  <html:head>
    <html:title>A Look Into HTML6</html:title>
  </html:head>
  <html:body>
    <!-- Image would come here -->
    <html:media src="img1/logo.jpg" type="image">
    <!-- Video doesn't need a type -->
    <html:media src="videos/slide.mov">
  </html:body>
</html:html>

<!DOCTYPE html>
<html:html>
  <html:head>
    <html:title>A Look Into HTML6</html:title>
  </html:head>
  <html:body>
    <!-- Image would come here -->
    <html:media src="img1/logo.jpg" type="image">
    <!-- Video doesn't need a type -->
    <html:media src="videos/slide.mov">
  </html:body>
</html:html>

标签类型概述 (An Overview of Tag types)

Similar to the current and previous HTML versions, HTML6 will also have two types of tags such as single tags and double tags. The single tags won’t be having any text content, and rather will only have attributes. For example:

与当前和以前HTML版本相似,HTML6也将具有两种类型的标签,例如单标签和双标签。 单个标签将没有任何文本内容,而是仅具有属性。 例如:


<html:meta type="author" content="z13a">
<html:meta type="author" content="z13a" />

<html:meta type="author" content="z13a">
<html:meta type="author" content="z13a" />

Compared to the double tag, you don’t need to close your single tag. Double tags have opening and closing tag, as they have some text content. But, in the case double tags don’t have any text based content, you can reduce it to the ‘self-closing single variant’. For example:

与双标签相比,您无需关闭单个标签。 双标签具有一些文本内容,因此具有开始和结束标签。 但是,在双标签没有任何基于文本的内容的情况下,您可以将其简化为“自闭合单变体”。 例如:


<html:link href="./a.html">Text based content</html:link>
<!-- This shortand... -->
<foo class="xyz" />
<!-- ...means in fact this: -->
<foo class="xyz"></foo>

<html:link href="./a.html">Text based content</html:link>
<!-- This shortand... -->
<foo class="xyz" />
<!-- ...means in fact this: -->
<foo class="xyz"></foo>

结论 (Conclusion)

HTML6 isn’t here yet. But an idea of what it will be offering has been provided by Oscar Godson. This post will help you provide an overview of some of the basic concepts of HTML6.

HTML6尚未发布。 但是,奥斯卡·戈德森(Oscar Godson)提出了将提供什么的想法。 这篇文章将帮助您概述HTML6的一些基本概念。

翻译自: https://www.script-tutorials.com/a-look-into-html6-what-is-it-and-what-it-has-to-offer/

–lang 谷歌浏览器

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值