p标签在h1中 [英] p tag in h1 for seo

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

问题描述

我想知道是否嵌套在< h1> 标记中的< p> 用于搜索引擎优化的目的。

 < h1> 
< p>一些标题< / p>
< p>一些字幕< / p>
< / h1>

这会让我的生活变得更轻松,处理动态页面标题。

解决方案

搜索引擎可能会忽略 p 标记内部 h1 。或者他们可能不喜欢它,做一些令人讨厌的事情。无论如何,使用这种标记都没有什么可以获得的。相反,您可以使用

 < h1> 
一些标题< br>
< small>某些字幕< / small>
< / h1>

然后,您可以通过设置 font-size h1小上。你也可以在它上面设置 padding-top ,如果你希望零件之间有更多的间距。



搜索可以期望引擎将 h1 元素视为仅包含某些标题的某些副标题。如果这是一个很长的标题,他们可能会放弃它的一部分(接近尾声),或者也许只是减少短标题所具有的权重的内容的相对重要性。

无论如何,您应该期望相对于页面上的其他内容,而不是外部世界(其他网页),标题中的单词具有相对权重。


I was wondering if using <p> tags nested in a <h1> tag would be bad for SEO purposes.

<h1>
    <p>some title</p>
    <p>some subtitle</p>
</h1>

This would make my life a bit easier, dealing with dynamic page titles.

解决方案

Search engines may ignore p markup inside h1. Or they might dislike it, doing something nasty. In any case, there is nothing to be gained by using such markup. Instead, you can use

<h1>
some title<br>
<small>some subtitle</small>
</h1>

You can then tune the relative sizes by setting font-size on h1 small. You can also set padding-top on it, if you wish to have more spacing between the parts.

Search engines can be expected to treat the h1 element as just containing "some title some subtitle". If this makes a long heading, they may discard part of it (near the end) or maybe just reduce the relative importance of the contents from the weight that a short heading would have.

In any case, you should expects words in headings have relative weight in SEO, relative to other contents on the page, not to the outside world (other web pages).

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

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