且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

h1和语义HTML5

更新时间:2023-09-03 11:03:10

你可以把标题想象成一本书的标题,h1就是这一章标题,但这并不总是适用于所有网站。如果您的网站是一本书,那么我的书将成为一个很棒的标题标签,每个页面上的h1都是第十章。这并不总是有效。谷歌表示,如果您有CompanyX,那么每个后续页面标题都应反映页面上的内容,如我们的产品而不是CompanyX - 我们的产品。但这就是搜索结果的布局。

You can think of the title as the title of a book and h1 is the chapter heading but this does not always work for all sites. If your site was a book, then "My Book" would make a great title tag along with the h1 on each page being "Chapter X". That won't always work. Google says if you have CompanyX then each subsequent page title should reflect what's on the page like "Our Products" instead of "CompanyX - Our Products". But that's for layout on their search results.

对于HTML5,正如其他人所说,页面上可以有很多部分,每个部分都有自己的h1标题。但是,您可能只有一个必需的h1标题页面。因此,考虑一个合适的title / h1组合需要一些思考。

With HTML5, as said by others, there can be many sections on a page, each with its own h1 heading. However, you may have a page with only one necessary h1 heading. So thinking of an appropriate title/h1 combination requires some thought.