h2 tag inside anchor tag

I’m confused. I set an <pre>< h2 ></pre> tag with an #id, and give it a background image. I want both the image and the text to be a clickable link. Thus, I want to wrap the <pre>< h2 ></pre> tag inside the anchor tag. Validator tells me it’s not valid HTML. I set the anchor to a class of .block, which is defined as <pre>.block {display:block}</pre>. Still doesn’t validate. Do you see the logic? Or, am I just making a mistake?

No webmentions were found