I'm a huge web standards advocate, but I have one question I'm a little stumped on; Is it alright to combine an anchor tag, and header tag?
Example
<h2><a href="link.html">My portfolio</a></h2>
I can't put my finger on it, but something deep down inside tells me there's a reason one shouldn't use this techn开发者_如何学运维ique. (Maybe because of search engine parsing, etc?) What are your thoughts?
What you have, an anchor inside an h2, is perfectly fine and is the most common way of doing it.
It's perfectly legal and okay. Search engines won't have trouble parsing that link.
Using an href inside of an h2 is perfectly acceptable, but since it's a heading, it's likely that a link can be added somewhere else (maybe inside a p
tag) because users do not usually expect links within headings.
精彩评论