Page 1 of 1

Question

Posted: Wed Jan 19, 2005 5:55 pm
by Josh
Okay, I\'ve been looking at a lot of code our site coders have been making and I\'m very curious if I\'ve always done my HTML wrong.

[code]<img src="http://www.site.com/my_image.jpg" alt="My Image" title="My Image">[/code]

This is what I would use if I were putting an image on my site yet on our site coder\'s coding they don\'t use the normal [b]>[/b] to close a tag -- they use [b] />[/b]

Example:

[code]<img src="http://www.site.com/my_image.jpg" alt="My Image" title="My Image" />[/code]

Is this proper to do?

Thanks in advance
~Josh /sp_ike.gif\' class=\'bbc_emoticon\' alt=\'(spike)\' />

Question

Posted: Wed Jan 19, 2005 6:18 pm
by ner0
yours would be valid html, the reason for the \" />\" is that the code is xhtml...

the img tag is an \"empty\" tag, meaning it has no need for a , and in order to ensure validity in xhtml you\'ll need to close the tag, hence the \" />\"

it\'s also the same with the html
, in xhtml this would be
(empty tag)

hope it helps

Question

Posted: Wed Jan 19, 2005 6:22 pm
by Josh
Thanks ner0 /smile.gif\' class=\'bbc_emoticon\' alt=\':)\' />