SEO, links and headers [closed]
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
开发者_如何学PythonClosed 10 years ago.
Improve this questionFrom an SEO perspective, what should I consider when deciding between these three markup structures? (or others if I'm missing something obvious)
<h2><a href="...">My Title</a></h2>
<p>...intro text...</p>
<a href="..."><h2>My Title</h2></a>
<p>...intro text...</p>
<h2>My Title</h2>
<p>...intro text... Read more about <a href="...">My Title</a></p>
The second one is wrong according to specs (the first one is the correct version of it). You cannot wrap a block level element in an inline level element.
Apart from that I do not think it would matter too much. As long as your HTML is generally well structured, position usability and pure design in front of search engines.
UPDATE: As pointed out in the comments below, this goes for HTML4. In HTML5, both would be allowed. However, I still prefer the first one; It's a heading that also happens to be a link more than it is a link that happens to also be a header.
The first two are equal as far as SEO is concerned. links in header tags carry more weight that regular links like the third example. However, adding the third link at the end of the article isn't a bad idea.
from a pure coding-spec standpoint, The first way is more correct. I would go with that.
All things considered, this is a really small difference that will have little to no impact on SEO, and I wouldn't lose any sleep over it.
精彩评论