Quick silly semantics question (links with emphasis)

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

I have a link that needs to have or applied. Should the or go inside or outside of the tag? Or does it matter?

Would it be:

Some Text

or

Some Text

I can't decide myself. I'm leaning towards it doesn't matter.

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

Though it shouldn't matter, I'd go with the first option because its DOM tree structure makes more sense to me. For example, if you had "a list of links", you might expect the first child node of every list item to be an anchor. But if it was wrapped in emphasis tags, then you'd get an em node instead.

As well, you can view the emphasis markup as being applied to the text (a DOM Text node), rather than the link itself. That is, the text would be emphasised whether it was a hyperlink or not. And if you did mean for the link to be emphasised, you'd use CSS anyway.

Smiling

He has: 1,758 posts

Joined: Jul 2002

Good question! The way I would decide is whether it's the link that's important or the text. If the link is important then use option one, otherwise use the second one.

Andy

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.