本文介绍了是否可以在同一页面上使用多个h1标签,但是风格不同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网页,我在各种DIV中多次使用h1标签,而我的样式h1为每个div都是合适的大小。

I have a webpage that I use h1 tags multiple times within various DIVs and I style h1 for each div to be the appropriate size.

例如...

#content h1 {
  font-size:22px;
}

#left-nav h1 {
  font-size:14px;
}

#content .recent-news h1 {
  font-size:16px;
}

我担心SEO。

这是最好的办法是什么?或者我不担心什么?

What is the best way to go about this? Or am I worrying about nothing?

推荐答案

在我看来,你不需要担心, this。

In my opinion, you don't need to worry, its ok to do it like this.

H1将您的内容的一部分指定为第一级标题。因此,如果您的导航div中有第一级标题(例如< H1>导航菜单< / H1> ),当然应该是 #nav h1

H1 designates part of your contents to be a first level heading. So if you have a first level heading in your navigation div (e.g. <H1>Navigation Menu</H1>), of course that should be #nav h1.

如果您应该在您的内容中有多个H1,取决于:如果您有博客,每个条目都有自己的标题,那些将是H1。但是,如果您的博客本身有标题(例如< H1>我的博客!< / H1> ),博客标题应为H2。

If you should have several H1s within your contents depends: If you have a blog and every entry has its own heading, those would be H1s. However, if your blog itself has a heading (e.g. <H1>My Blog!</H1>), the blog entry heading should be an H2.

但这只是理论。去寻找什么是可读的,语义标记。你可以通过查看你的html和问自己最好决定:它可读吗?如果我用另一种方法,可读性会改进吗?答案将因项目而异。

But that is only theory. Go for what is readable, semantic markup. You can best decide on that by looking at your html and asking yourself: 'Is it readable? Would the readability improve if I did it the other way?' The answer will vary from project to project.

这篇关于是否可以在同一页面上使用多个h1标签,但是风格不同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 04:47