h1和语义HTML5 [英] h1 and semantic HTML5

查看:89
本文介绍了h1和语义HTML5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近几天读过很多关于语义HTML的内容,而且我很困惑。

I´ve read alot about semantic HTML these last days, and I´m quite confused.

标题标签应该包含特定页面的内容和网站的名称。
h1和标题之间有什么区别?我读到h1应该包含页面的内容。我还读到,在HTML 5中,h1标签可以在页面上多次使用,并用于节中的标题(标题标签不起作用吗?)

The title tag should contain what the specific page is about and the web site´s name. What´s the difference between h1 and the title? I read that h1 should contain what the page is about as well. I also read that in HTML 5 the h1 tag can be used more than once on a page, and is used for headers in section (isn´t that the header tag´s work?)

如果我的页面上有一个带有我网站名称的图片,我应该使用什么标签?我总是虽然h1是为了那个。

If I have a logo on my page that is a picture with the name of my site, what tag should I use? I allways though h1 was for that.

推荐答案

你可以把标题想象成一本书的标题,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.

这篇关于h1和语义HTML5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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