+ 2
Attributes
Challenge question: “All HTML elements can have attributes.” Answer: True. My question: What attributes can a <br />, <pre>, <head>, <title> or <!Doctype html> element have?
10 odpowiedzi
+ 4
All HTML elements can have attributes due to global attributes.
Global attributes are attributes common to all HTML elements; they can be used on all elements, though they may have no effect on some elements.
https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes
<!Doctype HTML> is not a HTML element, it is considered a preamble/ declaration.
https://code.sololearn.com/Wc6oYR3W6iy0
+ 5
Tahiti🌍Castillo
I have been caught by the wording of that question also.
There are quite a few with misleading statements, but don't allow it to upset you.
+ 4
Rik Wittkopp Thank you for your understanding and civility.
+ 3
ODLNT Thank you for this cogent explanation. I’m sure it will also be helpful to others. It’s the disclaimer, “though they may have no effect on some elements,” that clears everything up.
+ 2
A͢J
I have noticed that we all use the English language in slightly different ways, with a simple sentence being interpreted differently by individuals.
English is my mother tongue, but quite often I note foreign speakers have a better understanding of the pure logic of the words.
+ 2
Actually they can, using <br/> as an example has global and event handler attributes.
+ 2
Samuel T.P I honestly had no idea that this was the case until today. I’ll need to brush up on event handler attributes. Thank you.
0
A͢J So the <br /> element “can have” an attribute?
0
A͢J Neither your question nor your answer above make any sense. Do I know the difference between “can have” and “have”? That’s an asinine, unhelpful question that seems like nothing more than an attempt to offend.
There either is a possibility, or there is no possibility. “Might be possibility” makes no sense. If an example can’t be cited as precedent for the possibility, then there must not be a possibility.
0
A͢J Again, there is no sense in your question, because it was snarky and unwarranted. I obviously know the difference between “can have” and “have”. Your answer makes sense to you. It does not make sense to me.