Is it SEO safe to embed the H2 or H3 tag in a hyperlink element?
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?!".
- 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
Related videos on Youtube
bumerang
Updated on September 18, 2022Comments
-
bumerang almost 2 years
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 theh3
tag into ana
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>
-
John Conde almost 8 yearsThat's not valid HTML
-
illinoistim almost 8 yearsDo you have a h1 tag as well?
-
bumerang almost 8 years@illinoistimYes I have one h1
-
bumerang almost 8 years@John Conde according to this validator validator.w3.org/nu/#textarea (just put my HTML) it is valid
-
unor almost 8 yearsWhat does such an
a
element contain exactly? The heading for the offer name and a short description? Or more/longer content? Would each offer be in ali
element which contains nothing else?
-
-
marcanuy almost 8 years@bumerang I've updated the answer.
-
Nathan Arthur almost 8 yearsGood answer. I've done things like this when linking title & excerpt cards to blog posts. But, yeah, probably not a wise SEO strategy if that's the only reason you're doing it.