大网数据广告活动
网站运营与故障问答

Is it SEO safe to embed the H2 or H3 tag in a hyperlink element?

· 52CE 我爱测

I'm making a new layout for our website, and I want to make a list using the unordered list tag ( ul ) to show our offers. But because of our design I would like to use the h3 tag into an a element. How would my idea impact SEO? …

问题原文

原帖链接 · bumerang · CC BY-SA 3.0

I'm making a new layout for our website, and I want to make a list using the unordered list tag (ul) to show our offers. But because of our design I would like to use the h3 tag into an a element.

How would my idea impact SEO?

Here's an example in code of what I'm trying to achieve:

<a><h3>Header</h3><p>Text</p></a>

I believe the following HTML (which contains my idea) is valid, but how would it affect SEO?

<!DOCTYPE html>
<html>
    <head><title>Test</title>
    <body>
        <a>
            <h3>Header</h3>
            <p>Text</p>
        </a>
    </body>
</html>

已采纳解答

原帖链接 · Martijn · CC BY-SA 4.0

The rules are simple regarding to this:

You are not allowed to wrap an inline element around a block element.
The exception: If you use HTML5, you may wrap in anchor around a block element.

From a SEO perspective it doesn't have influence, it's valid html so they wont discredit for that.

It doesn't help either. You're ramming a whole paragraph into an anchor, making the value of each word in it very very small, and you also stuff it with words your don't care about ("This is an example" » only keyword is 'example', yet the whole sentence is the anchor).

From User Interface point of view, it can (depends on the implementation) be very odd, the whole paragraph is a link? "Huh, I just clicked plain text and now I've changed page?!".

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2016-06-29)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0 / CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。