<b>, <i>, <em>, <strong> tag placement - does it matter?

Discussion in 'HTML & Website Design' started by bluebetta, Jan 3, 2011.

  1. #1
    Hello,

    I know this is a very simple question so I'm hoping for a quick answer. Let's say I have a link and I want that link to be bold (but I don't want to use CSS for this particular link) so I add a <b> tag. Should the <b> tag go inside of the link or outside, or does it even matter?

    Example 1:

    <a href="http://www.google.com"><b>Google is bold and a link</b></a>
    Code (markup):
    or should it be:

    Example 2:

    <b><a href="http://www.google.com">Google is bold and a link</a></b>
    Code (markup):

    or again, does it matter? Both seem to work for me, but I'm wondering if one isn't valid. I like the way the first one looks better, putting the <b> tags inside the link tags, so that is what I did when coding my site. If anyone thinks the bold tags should go outside of the link (like example 2) please let me know.

    Update: Actually, I've decided to use CSS. I realized it's just as easy and a better solution.
     
    Last edited: Jan 3, 2011
    bluebetta, Jan 3, 2011 IP
  2. Moustafa.Elkady

    Moustafa.Elkady Member

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    31
    #2
    i'm prefer the <a>iam</a> is inside and any thing else out site
    because the a will add the link to the inside
    like if you make something like <a><table>iam</table></a>
    you can click table :(
     
    Moustafa.Elkady, Jan 3, 2011 IP