Showing 1 – 2 of 2 replies
allberg

Yes, I mean works nicely in pure HTML […]

allberg PURCHASED
6 years ago
Hi Ondrej!

Yes, I mean <img> versus <img /> and you're totally right, <img> works nicely in pure HTML.

However, when putting them in a JSX file to be handled by reactjs (a javascript framework by Facebook and Instagram) it requires the tags to be closed.

I'm not saying that your html is wrong, but it would be helpful if in the next release the tags would be closed, to be more "react-compatible" so to speak.

Best regards,

John
ondrique
ondrique SELLER
6 years ago
Hi John,

thanks for your reply, I see.

Unfortunately, I can't help you with this as this is an HTML template, so I need to stick with the HTML specs.

Quoting from https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img - "<img> must have a start tag and must not have an end tag".

Sorry, I could not help more.

Best,

Ondrej
allberg
allberg PURCHASED
6 years ago
You're totally right, a img tag may never have an end tag since the img is a void element or empty element. But I'm not talking about the end tag ("</img>"), I'm talking about the optional slash at the end of the start tag:

http://w3c.github.io/html-reference/syntax.html#void-element
"5. Optionally, a "/" character, which may be present only if the element is a void element."

But I'm not going to nag you about this, it was just a friendly request. I think it's a really good template, so keep up the good work!