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