Can all html elements have attributes? What attribute <! DOCTYPE html> can have ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

Can all html elements have attributes? What attribute <! DOCTYPE html> can have ?

Today I have played a challenge against Vikash Pal and there was a question that all elements can have attribute. It was true/false question and I choose false. It went wrong. Is that mean <!doctype html> element can hold any kind of attribute?

11th May 2018, 6:58 AM
Akash Pal
Akash Pal - avatar
8 Answers
+ 6
No. It can not have attributes. <!DOCTYPE> is not a tag, it is a declaration that allows the browser to know what kind of document it will interpret. Btw, all tags can have attributes. There are some that only allow global attributes or whose behavior will not be altered by them, but they are allowed. https://www.w3schools.com/html/html_attributes.asp https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes
11th May 2018, 7:08 AM
Mickel
Mickel - avatar
+ 4
Mickel Sánchez So the Question which asks which tag cannot have attribute was false. Because the answer was <!DOCTYPE html>.
11th May 2018, 7:20 AM
Akash Pal
Akash Pal - avatar
+ 3
so what attribute is for <br> or <big> <b> ,<i>? Before the ans was false now it changed to true. Not only that now mailto : needs a freaking space in between colon otherwise its a mistake? Same with a text area question. I got more.. just lost 4 in a row because of some of these retarded answers of new challenges.
11th May 2018, 7:16 AM
Akib
Akib - avatar
+ 3
Report the question and indicate that it is not a tag, but a statement. There are wrong questions in several languages, but if you report it they are fixed in a few days (in my case it has been like this)
11th May 2018, 7:24 AM
Mickel
Mickel - avatar
+ 3
Akib Reza i found that space before "mailto" weird too. reported it as wrong. we shouldn't be too hard with sololearn. they can't catch everything :)
11th May 2018, 9:24 AM
storm
storm - avatar
+ 2
Akib Reza They admit global attributes like style, id, class, data-*, etc. https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes
11th May 2018, 7:19 AM
Mickel
Mickel - avatar
0
i cant suggest my own quiz in the quiz factory using HTML weapon... i dont know why!!!
11th May 2018, 10:02 AM
Loic Chabou
Loic Chabou - avatar
0
It is the declaration of a html 5 page, not a tag.
18th May 2018, 12:34 PM
Prabodh Panda
Prabodh Panda - avatar