Forum Moderators: open

Message Too Old, No Replies

<a> inside <em>

or vice versa

         

jetboy

4:59 pm on Aug 9, 2005 (gmt 0)

10+ Year Member



Possibly my most pointless post on WebmasterWorld (and hell, there's been some stiff competition), but this has got me thinking ...

In a line of text, where the <em> element is used for semantic emphasis, and I want to make a link, should the <a> element be inside or outside the <em> tags?

Lorem ipsum dolor sit amet, <a href...><em>consectetuer</em></a> adipiscing elit.

or

Lorem ipsum dolor sit amet, <em><a href...>consectetuer</a></em> adipiscing elit.

Would all user agents (screen readers in particular) treat these as identical?

moltar

6:23 pm on Aug 9, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I prefer <em><a>. No particular reason, just looks more aesthetically.

jetboy

6:39 pm on Aug 9, 2005 (gmt 0)

10+ Year Member



I guess there are advantages in having the <a> as the inner element for styling things like a:hover, particularly with IE.