Hello, Sometimes I have problems by closing certain tags, namely the <img> tag. W3 Schools shows this example: <img src="smiley.gif" alt="Smiley face" height="42" width="42"> But the V3 Validator and also other programs who me "unclosed tag", so I simply add </img> Another way is to write: <img src="image.gif"></img> What do you think about these, how is it best to code them? These and similar tags? As I know, there are self-closing tags, but in practice it doesn't always work. And I don't want to collect negative point in Google because of this. Tips, advice ideas?
If you are validating as HTML, what you posted should be fine. It's valid HTML 4.01. If you're using xHTML then use what bowodesign posted.
<img ... /> is not unclosed. If the W3C validator passes it, it's valid (since they pretty much decide what's valid). If another validator says it's unclosed, you've found a defective validator.