Need help on a markup problem

On one of my pages there is an image. I need help deciding how it should be marked up—or rather, where it should be in the source. <img> isn’t valid in the body directly, so I have a few choices:

  • Contain it in the previous paragraph (how it is currently)
  • Leave it outside the paragraph, which is invalid, but more semantically correct (I think?)
  • Put a <div>, which would be valid and semantically correct but redundant (or would it be? does having the div there mean the existance of something that shouldn’t be there?)
  • Use <object> instead, which would be semantically correct and valid, but I’d have to look up the syntax for

So which should I chose?

Edit: Eep, forgot to close my <a> tag… actually, forgot to even give it content. Fixed now.

One Response to “Need help on a markup problem”

  1. Jimmy Cerra Says:

    If you are only using Firefox, I’d go with object for semantic reasons. For general use I think putting it into the paragraph is more semantic, since it belongs with the rest of the information in that paragraph. Otherwise, the most practical option for the web today is probably to use a div element for compatibility reasons and the generally OK semantics.

Leave a Reply

Bad Behavior has blocked 486 access attempts in the last 7 days.