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

9,750

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

Share:
9,750

Related videos on Youtube

bumerang
Author by

bumerang

Updated on September 18, 2022

Comments

  • bumerang
    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 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>
    
    • John Conde
      John Conde almost 8 years
      That's not valid HTML
    • illinoistim
      illinoistim almost 8 years
      Do you have a h1 tag as well?
    • bumerang
      bumerang almost 8 years
      @illinoistimYes I have one h1
    • bumerang
      bumerang almost 8 years
      @John Conde according to this validator validator.w3.org/nu/#textarea (just put my HTML) it is valid
    • unor
      unor almost 8 years
      What 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 a li element which contains nothing else?
  • marcanuy
    marcanuy almost 8 years
    @bumerang I've updated the answer.
  • Nathan Arthur
    Nathan Arthur almost 8 years
    Good 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.