I am trying to figure out if the XML styling for void elements is correct for images in HTML 5.

<img src="">

or

<img src="" />

1 answer

3
points
This was chosen as the best answer

You can use either.

http://www.w3.org/TR/html5/introduction.html#html-vs-xhtml has the details.

Answered about 6 years ago by Ben Boyle
  • Yes, but one must be the "more correct" direction of HTML now that we are leaving XHTML. I've always used the XML style - but now that things are changing perhaps it's time I change also. Xeoncross about 6 years ago