Mobile app version of vmapp.org
Login or Join
Odierno851

: Is it SEO safe to embed the H2 or H3 tag in a hyperlink element? 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.

@Odierno851

Posted in: #Heading #Html #Hyperlink #Seo

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>

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Odierno851

3 Comments

Sorted by latest first Latest Oldest Best

 

@Twilah146

Good SEO comes from good page content. Good SEO also comes from correct markup. Naturally as HTML5 is a total mess of non-clear markup rules I would stick to Xhtml versions if you do not need canvas commands. Anyhow I would not play tricks. I would get great page content and proper markup and make lots of pages and get good results. Google feels the love you put into your work.

10% popularity Vote Up Vote Down


 

@Deb1703797

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. Your 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?!".


David Walsh has a small article with almost the exact same example
Which is more correct: <h1><a>..</a></h1> OR <a><h1>..</h1></a> from SEO point of view?
Difference between a block and an inline element

10% popularity Vote Up Vote Down


 

@Ravi8258870

Wrapping an anchor around blocks is acceptable in HTML5, not in previous versions like HTML 4/XHTML.

In HTML5 we have:


The a element may be wrapped around entire paragraphs, lists, tables,
and so forth, even entire sections, so long as there is no interactive
content within (e.g. buttons or other links).


-> www.w3.org/TR/html5/text-level-semantics.html#the-a-element
e.g.:

<aside class="advertising">
<h1>Advertising</h1>
<a href="http://ad.example.com/?adid=1929&amp;pubid=1422">
<section>
<h1>Mellblomatic 9000!</h1>
<p>Turn all your widgets into mellbloms!</p>
<p>Only .99 plus shipping and handling.</p>
</section>
</a>
<a href="http://ad.example.com/?adid=375&amp;pubid=1422">
<section>
<h1>The Mellblom Browser</h1>
<p>Web browsing at the speed of light.</p>
<p>No other browser goes faster!</p>
</section>
</a>
</aside>


So yes, it is valid HTML and safe to use it if you use HTML5, it won't be safe if you want to make it compatible with other versions of HTML.

Update
Is this SEO valid?

This is just like asking if using an HTML tag is valid for SEO, they are not valid per se, but what makes them SEO valid is the context where they are used.

If it was not valid HTML then it won't be appropriate for SEO, but being valid HTML doesn't makes it SEO valid, it will depend how you use it to structure your content.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme