0
Please someone should help make this clear to me!!!
I encountered two different questions in the challenge section of html. I feel like at least one of them needs to be addressed. The first says "is the forward slash(/) in the void elements optional or not?". The answer was yes it was optional. Then comes the other question which was "which of the follwing is a valid code": <img src="a.png" alt=""> <img src="a.png" alt=""/> GOING BY THE ANSWER OF THE FIRST QUESTION, ARE THE OPTIONS OF THE SECOND QUESTION NOT SUPPOSED TO BE ALL CORRECT?
5 Answers
+ 1
How we can tell without incomplete information.
0
what I mean is "are all the above options of question two not supposed to be correct?
0
The forward slash is used when you want to close a tag. So instead of writing the whole </img> tag, "/" shortcut is used. <img> does not require the closing tag. But in some occasions, it is required.
0
I think both are correct. The one with '/' is written following XHTML standard, the one without, is following HTML standard. In XHTML a pairless tag is written with a '/' as standard requirement.
I could be wrong, but if I were not, then a report on that question is in order. Except if the question was a multiple choice type, where both can be chosen.
0
it was a multiple choice question and only one could be chosen