Possible Duplicate:
Is it right to add <span> tag inside <a> tag?
<a href="domainname"><strong>Its Me</strong></a>
OR
<strong><a href="domainname">Its Me</a></strong>?
What is the difference between the two above?
Possible Duplicate:
Is it right to add <span> tag inside <a> tag?
<a href="domainname"><strong>Its Me</strong></a>
OR
<strong><a href="domainname">Its Me</a></strong>?
What is the difference between the two above?
<strong><a href="domainname">Its Me</a></strong>
is the recommended XHTML syntax, but it doesn't matter.
But there is no real difference between the two. It's like asking what is the difference between
5 + 2 and 2 + 5, there is no difference in logic, just in syntax.
Both are perfectly valid.
<strong>
is used to give semantic weighting to the contained element, so I guess it's a choice between whether it's the link or the link's content that you're trying to give emphasis to.
Personally I always put <strong>
inside <a>
but that's probably just a habit I've picked up over the years.
No visual different, but <strong>
tag is text formatting tag.
Look at my example:
<html>
<body>
<div style="color:red;"><strong>hello</strong></div>
<strong><div style="color:red;">hello2</div></strong>
<strong><div style="color:red;">hello3</strong></div>
</body>
</html>
Last 2 lines are incorrect, but in visual all lines are strong (thanks to your browsers). Be smart, write clean code! ;-)