Mobile app version of vmapp.org
Login or Join
Sue5673885

: W3C Compliance v SEO Possible Duplicate: Anchor tag inside H1 or H1 inside achor tag : Which is better? I am being advised to place a H2 tag within a A href tag. To me this

@Sue5673885

Posted in: #Html #Seo #Standards

Possible Duplicate:
Anchor tag inside H1 or H1 inside achor tag : Which is better?




I am being advised to place a H2 tag within a A href tag.
To me this does not meet with standards and may even be considered as black hat techniques (or at least grey) I have expressed my concerns but they are insisting its a valid SEO technique.

If I run the code past W3C Markup Validation Service it fails and must admit I do get a bit anal regarding using correct syntax on our website.

Am I being too picky over conforming to standards which in my mind would make it easier for a search engine to read or am I missing a trick here. ?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Sue5673885

2 Comments

Sorted by latest first Latest Oldest Best

 

@Odierno851

In html5 you can put the any block-type element inside the anchor tag:


Although previous versions of HTML restricted the a element to only
containing phrasing content (essentially, what was in previous
versions referred to as “inline” content), the a element is now
transparent; that is, an instance of the a element is now allowed to
also contain flow content (essentially, what was in previous versions
referred to as “block” content)—if the parent element of that instance
of the a element is an element that is allowed to contain flow
content.

dev.w3.org/html5/markup/a.html#a-changes
Just use html5 and it will validate. AFAIK putting a header tag inside a anchor tag is not consider black-hat.

10% popularity Vote Up Vote Down


 

@Pope3001725

Placing a hyperlink in a heading is perfectly fine. WordPress posts have their titles in <hx> tags (I think it's <h1> on the individual post page and <h2> on the category pages) and are hyperlinked and they are well indexed and ranked.

What you are seeing is that the HTML is poorly formatted. The anchor goes inside the heading. Not the other way around. Remember, inline elements go inside block level elements, not the other way around.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme