Syntax discrepancy between style lessons and quiz


#1

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?


Lesson Example: <p style="font size: 12px">This is sample text.</p>
Quiz says correct way is: <p style="font size: 12px;">This is sample text.</p>


#2

neither is right.
The correct property is font-size not font size... So the correct syntax must be:

<p style="font-size: 12px;">This is sample text.</p>

for more look here and here


#3

if you use font-size, both are valid. Sometimes there are multiply correct ways


#4

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:
https://www.codecademy.com/en/courses/web-beginner-en-y2Yjd/1/2?curriculum_id=50579fb998b470000202dc8b

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.


#5

do you have a screenshot of the quiz question?


#6

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.