热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Html:h1标签应该用于网站标题还是页面标题?-Html:Shouldtheh1tagbeusedforthesitetitleorthepagetitle?

InthepastIhaveoftenputthesitetitleinan<h1>tag,andthenthemainpagetitleinan

In the past I have often put the site title in an

tag, and then the main page title in an

. Is this considered correct, or should the main page title be in the

tag? If so, where do you put the site title? In a regular
? Or?

在过去,我经常将网站标题放在

标签中,然后将主页标题放在

中。这被认为是正确的,还是主页标题应该在

标签中?如果是这样,你在哪里放置网站标题?在常规
?要么?

What is the most semantically correct, and what is the best when considering things like accessibility?

什么是最语义正确的,在考虑可访问性等问题时最好的是什么?

3 个解决方案

#1


6  

There's no real standard and there are quite a few differing opinions. I agree with womp though: you shouldn't have the same H1 on every page of the site. I'd leave the site title to the

Semantically (and to aid accessibility), the generally accepted rule is one

per page or topic. It's valid to have more than one top-level heading on a page, as long as those headings break the document into separate logical chunks discussing different things. So to take the example of a blog home page showing the five most recent articles, it would be fine for each to have its own

.

在语义上(并且为了辅助可访问性),通常接受的规则是每页或主题一个

。只要这些标题将文档分解为讨论不同内容的单独逻辑块,在页面上有多个顶级标题是有效的。因此,以博客主页为例展示最近的五篇文章,每个人都可以拥有自己的 。

However, when it comes to SEO, the recommendations are usually that you only have one H1 per page.

但是,当涉及到SEO时,建议通常是每页只有一个H1。

I've gone for a hybrid approach on my design blog: on the home page, there is an H1 describing the site, and each post title is an

. However, on the individual post pages, the post title is the

. This seems (so far) to strike a good balance between semantics and optimising for search engines.

我在设计博客上采用了混合方法:在主页上有一个描述网站的H1,每个帖子标题都是

。但是,在各个帖子页面上,帖子标题是

。这似乎(到目前为止)在语义和搜索引擎优化之间取得了良好的平衡。

#2


5  

It's better if H1 tags are contextually related to the majority of the content on the page - so it should really be the page title.

如果H1标签与页面上的大部分内容在上下文中相关,那就更好了 - 所以它应该是页面标题。

If every page has the same H1 tag (i.e. the site title), it degrades the value of them (and overall, they are really the most valuable tag).

如果每个页面都有相同的H1标签(即网站标题),它会降低它们的价值(总的来说,它们确实是最有价值的标签)。

If you're putting the site title in the header as something that's not an image with alt text, I would usually just style up a div or a span.

如果您将网站标题放在标题中,而不是带有替代文字的图像,我通常会设置div或span的样式。

#3


3  

On page 20 of Google's Search Engine Optimization Starter Guide :

在Google搜索引擎优化入门指南的第20页上:

Use heading tags appropriately

适当使用标题标签

On a page containing a news story, we might put the name of our site into an

tag and the topic of the story into an

tag.

在包含新闻报道的页面上,我们可能会将我们网站的名称放入

标记中,并将故事主题放入

标记中。


推荐阅读
  • Iamtryingtomakeaclassthatwillreadatextfileofnamesintoanarray,thenreturnthatarra ... [详细]
  • Linux重启网络命令实例及关机和重启示例教程
    本文介绍了Linux系统中重启网络命令的实例,以及使用不同方式关机和重启系统的示例教程。包括使用图形界面和控制台访问系统的方法,以及使用shutdown命令进行系统关机和重启的句法和用法。 ... [详细]
  • CSS3选择器的使用方法详解,提高Web开发效率和精准度
    本文详细介绍了CSS3新增的选择器方法,包括属性选择器的使用。通过CSS3选择器,可以提高Web开发的效率和精准度,使得查找元素更加方便和快捷。同时,本文还对属性选择器的各种用法进行了详细解释,并给出了相应的代码示例。通过学习本文,读者可以更好地掌握CSS3选择器的使用方法,提升自己的Web开发能力。 ... [详细]
  • 本文讨论了一个关于cuowu类的问题,作者在使用cuowu类时遇到了错误提示和使用AdjustmentListener的问题。文章提供了16个解决方案,并给出了两个可能导致错误的原因。 ... [详细]
  • springmvc学习笔记(十):控制器业务方法中通过注解实现封装Javabean接收表单提交的数据
    本文介绍了在springmvc学习笔记系列的第十篇中,控制器的业务方法中如何通过注解实现封装Javabean来接收表单提交的数据。同时还讨论了当有多个注册表单且字段完全相同时,如何将其交给同一个控制器处理。 ... [详细]
  • 本文介绍了南邮ctf-web的writeup,包括签到题和md5 collision。在CTF比赛和渗透测试中,可以通过查看源代码、代码注释、页面隐藏元素、超链接和HTTP响应头部来寻找flag或提示信息。利用PHP弱类型,可以发现md5('QNKCDZO')='0e830400451993494058024219903391'和md5('240610708')='0e462097431906509019562988736854'。 ... [详细]
  • Ihavethefollowingonhtml我在html上有以下内容<html><head><scriptsrc..3003_Tes ... [详细]
  • 本文介绍了在处理不规则数据时如何使用Python自动提取文本中的时间日期,包括使用dateutil.parser模块统一日期字符串格式和使用datefinder模块提取日期。同时,还介绍了一段使用正则表达式的代码,可以支持中文日期和一些特殊的时间识别,例如'2012年12月12日'、'3小时前'、'在2012/12/13哈哈'等。 ... [详细]
  • 如何自行分析定位SAP BSP错误
    The“BSPtag”Imentionedintheblogtitlemeansforexamplethetagchtmlb:configCelleratorbelowwhichi ... [详细]
  • Commit1ced2a7433ea8937a1b260ea65d708f32ca7c95eintroduceda+Clonetraitboundtom ... [详细]
  • Java容器中的compareto方法排序原理解析
    本文从源码解析Java容器中的compareto方法的排序原理,讲解了在使用数组存储数据时的限制以及存储效率的问题。同时提到了Redis的五大数据结构和list、set等知识点,回忆了作者大学时代的Java学习经历。文章以作者做的思维导图作为目录,展示了整个讲解过程。 ... [详细]
  • 阿,里,云,物,联网,net,core,客户端,czgl,aliiotclient, ... [详细]
  • 本文介绍了基于c语言的mcs51单片机定时器计数器的应用教程,包括定时器的设置和计数方法,以及中断函数的使用。同时介绍了定时器应用的举例,包括定时器中断函数的编写和频率值的计算方法。主函数中设置了T0模式和T1计数的初值,并开启了T0和T1的中断,最后启动了CPU中断。 ... [详细]
  • JavaSE笔试题-接口、抽象类、多态等问题解答
    本文解答了JavaSE笔试题中关于接口、抽象类、多态等问题。包括Math类的取整数方法、接口是否可继承、抽象类是否可实现接口、抽象类是否可继承具体类、抽象类中是否可以有静态main方法等问题。同时介绍了面向对象的特征,以及Java中实现多态的机制。 ... [详细]
  • Python正则表达式学习记录及常用方法
    本文记录了学习Python正则表达式的过程,介绍了re模块的常用方法re.search,并解释了rawstring的作用。正则表达式是一种方便检查字符串匹配模式的工具,通过本文的学习可以掌握Python中使用正则表达式的基本方法。 ... [详细]

author-avatar
mobiledu2502857827
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有