首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么元标记使用名称-内容对而不是常规属性?

为什么元标记使用名称-内容对而不是常规属性?
EN

Webmasters Stack Exchange用户
提问于 2012-01-02 18:18:33
回答 1查看 78关注 0票数 0

更多的是一个理论问题,但如果只有一个meta标记和一组属性值对,难道不是更有意义吗?而不是:

代码语言:javascript
复制
<head>
    <meta charset="UTF-8" />
    <meta name="author" content="Joe Schmoe, jks@example.com" />
    <meta name="description" content="An article that summarizes the risks 
        and benefits of playing video games for high school students." />
    <meta name="keywords" content="video games, high school students, 
        development, cognition, learning, problem solving, strategy, 
        parenting, time management, procrastination" />
    <title>I'm About to Graduate but I'm Obsessed with Skyrim</title>
    ...
</head>

它难道不节省一些字节,只写:

代码语言:javascript
复制
<head>
    <meta charset="UTF-8" author="Joe Schmoe, jks@example.com" 
        description="The risks and benefits of playing video games 
            for high school students."
        keywords="video games, high school students, development, 
            cognition, learning, problem solving, strategy, 
            parenting, time management, procrastination" />
    <title>I'm About to Graduate but I'm Obsessed with Skyrim</title>
    ...
</head>

如果name属性的值是预先设置的,为什么不直接设置它们呢?对于网页作者来说,我的方法会更容易、更流畅,而且我相信重新编写网站爬虫/机器人来理解它也会很容易。与此相关的是,有什么原因不能这样做吗?

EN

回答 1

Webmasters Stack Exchange用户

发布于 2012-01-02 21:05:17

这都是通过W3C for HTML4实现的标准的一部分。

http://www.w3.org/TR/html4/struct/global.html#h-7.4.4中使用元标记的规范

将您的更改写在建议中,并将其发送给W3C,作为修改标准的建议。

争取支持,获得普遍共识,以使其获得通过,并将其纳入HTML6。

票数 1
EN
页面原文内容由Webmasters Stack Exchange提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://webmasters.stackexchange.com/questions/24068

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档