Please someone should help make this clear to me!!! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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?

22nd Mar 2020, 7:57 AM
Ahmad Adamu Abdullahi
Ahmad Adamu Abdullahi - avatar
5 Answers
+ 1
How we can tell without incomplete information.
22nd Mar 2020, 7:59 AM
A͢J
A͢J - avatar
0
what I mean is "are all the above options of question two not supposed to be correct?
22nd Mar 2020, 8:47 AM
Ahmad Adamu Abdullahi
Ahmad Adamu Abdullahi - avatar
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.
22nd Mar 2020, 9:00 AM
Taranjeet
Taranjeet - avatar
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.
22nd Mar 2020, 10:09 AM
Ipang
0
it was a multiple choice question and only one could be chosen
22nd Mar 2020, 11:17 AM
Ahmad Adamu Abdullahi
Ahmad Adamu Abdullahi - avatar