文章页中的H1 - 网站标题或文章标题? [英] H1 in article page - site title or article title?

查看:133
本文介绍了文章页中的H1 - 网站标题或文章标题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在面向文章的页面(例如博客文章)中,< h1> 元素(1级标题)通常用于标记: )以及<$ c $ c $< title> 元素)或

  • 文章标题



  • 什么是最佳选择以及为什么?对于网站所有者,他们可能想向全世界喊出他们的网站/博客的名称,使用围绕网站标题的1级标题似乎有意义。



    从您尝试与用户沟通的角度来看,网站标题为相关性较小 - 文章内容就是您想要沟通的内容,而所有其他网站内容都是次要的。因此,对于文章标题使用< h1> 似乎是最好的。 我感觉 < h1> 元素应该关注文章标题,而不是网站标题或其他内容。这似乎并不是一个受欢迎的约定。



    例子:



    这是三种不同的方法三个站点,您可能会希望强调正确的语义标记。



    我认为Joel与Jeff的关系紧密。对于37Signals人员的标记选择,我感到非常惊讶。

    对我来说,这似乎是一个非常简单的决定:什么与文章的消费者最相关?文章标题。因此将文章标题包装在< h1> 元素中。完成。



    我错了吗?我缺少更多考虑吗?我对吗?如果是这样,为什么'< h1> 为文章标题'方法不常用?

    是决定在哪里使用< h1> 元素作为我所说的不变的?或者是否还有一些主观方面的考虑?



    更新:感谢迄今为止的所有答案。我真的很感激一些关于如何使用< h1> 作为文章标题而不是站点标题使可用性和可访问性(或者不案件可能会也可能不会)。基于事实而不是个人假设的答案会得到很多奖励分!

    解决方案

    有一个 W3C Quality Assurance tips 关于这个主题:


    < h1> 是文档的
    第一级标题的HTML元素:




    • 如果文档基本上是
      单独的,例如在日内瓦看到
      和Do的东西,则顶级
      标题可能与
      标题相同。如果它是
      集合的一部分,例如关于
      的部分,那么关于
      的一组页面中的狗宠物,那么顶级标题
      应该假定一定数量的
      上下文;只需在< h1> Dogs< / h1>
      中写入标题,即可在任何
      上下文中使用:Dogs - Your Guide to Pets。 p>




    Within an article-oriented page (such as a blog post), the <h1> element (level 1 heading) is commonly used to markup either:

    • the blog title (i.e. the often-large site title at the top of the page, not to the <title> element), or
    • the article title

    What is the best choice and why?

    To the site owner, who may want to shout out to the world the name of their site/blog, using a level 1 heading around the site title might seem to make sense.

    From the perspective of what you are trying to communicate to the user, the site title is of less relevance - the article content is what you're trying to communicate and all other site content is secondary. Therefore using <h1> for the article title seems best.

    I feel the <h1> element should focus on the article title, not the site title or other content. This does not appear to be a popular convention by any means.

    Examples:

    • Joel Spolsky uses <h1> for the article title, and an anchor for the site title
    • Jeff Atwood uses no <h1> at all, <h2> for the article title and an anchor for the site title
    • 37 Signals' SVN uses <h1> for the site title and an anchor for the article title

    That's three different approaches across three sites where you might expect a strong consideration for correct semantic markup.

    I think Joel has it right with Jeff a close second. I'm quite surprised at the markup choices by the 37Signals people.

    To me it seems quite a simple decision: what is of greatest relevance to the consumer of the article? The article title. Therefore wrap the article title in an <h1> element. Done.

    Am I wrong? Are there further considerations I'm missing? Am I right? If so, why is the '<h1> for article title' approach not more commonly used?

    Is the decision of where to use the <h1> element as invariable as I put it? Or are there some subjective considerations to be made as well?

    Update: Thanks for all the answers so far. I'd really appreciate some angle on how the use of the <h1> for the article title instead of site title benefits usability and accessibility (or doesn't, as the case may or may not be). Answers based on fact instead of just personal supposition will get many bonus points!

    解决方案

    There is a W3C Quality Assurance tip about this topic:

    <h1> is the HTML element for the first-level heading of a document:

    • If the document is basically stand-alone, for example Things to See and Do in Geneva, the top-level heading is probably the same as the title.

    • If it is part of a collection, for example a section on Dogs in a collection of pages about pets, then the top level heading should assume a certain amount of context; just write <h1>Dogs</h1> while the title should work in any context: Dogs - Your Guide to Pets.

    这篇关于文章页中的H1 - 网站标题或文章标题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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