I just completed HTML Basics II and quiz and noticed a discrepancy in syntax used for style attributes.
The syntax examples given in the lessons do not show a semi-colon at the end of a style attribute. I took the quiz and got all the questions related to font-size, font-family etc. wrong because the quiz says that a semi-colon belongs at the end of the statement even if there is only one attribute.
Which is the correct syntax?
<Below this line, add a link to the EXACT exercise that you are stuck at.>
<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>
This is sample text.
Quiz says correct way is:
This is sample text.
<do not remove the three backticks above>
neither is right.
The correct property is
font size… So the correct syntax must be:
<p style="font-size: 12px;">This is sample text.</p>
for more look here and here
if you use
font-size, both are valid. Sometimes there are multiply correct ways
Sorry, I did mean font-size but the issue is that the lesson shows the syntax as one without the semi-colon at the end but when I entered it that way in the quiz it said it was wrong. When it showed the correct syntax in the quiz my code was right with the exception of the semi-colon at the end.
Here is the link to the font-size lesson I am talking about:
The lesson shows:
<p style="font-size: 12px">
and the quiz requires the following syntax in order for the answer to be correct:
<p style="font-size: 12px;">
I just wanted to point out that the quiz does not count all variations of the syntax as correct. Since the lesson taught the syntax without the semi-colon that is what I used in the quiz. Being new, I did not know that there was an alternate option to add the semi-colon which is what the quiz wanted and subsequently I got the questions “wrong”. This issue was not limited to just the font-size lesson but was also present in the the other style attribute lessons.
do you have a screenshot of the quiz question?
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.