For some reason I cannot pass this challenge because I am failing to meet this requirement: " You should use an h2 CSS selector to change the font." I cannot identify what is wrong in my code.
@Mr-Kumar-Abhishek That would be a class selector. That is not what the challenge is asking for, it wants you to use an element selector.
@laurel2 You added a font-size rule which you were not asked to do. Remove that and remember the semicolon ; at the end of the style rule.
Also, you should remove the class you added to the h2 element as it serves no purpose (won’t make the test fail though) and I’d also suggest you always put each style rule on its own line.
@lasjorg thanks for pointing it out, but the problem only mentions css selector which means it could either be class selector or element selector. I tested it out.
It might not be 100% obvious from the initial challenge requirement, but if you look at the tests, I think it is.
You should use an h2 CSS selector to change the font.
When it says “h2 CSS selector” it is referring to an element selector.
The fact that you can pass the challenge using a class selector is really a bug in the regex used to check for the selector (it’s an edge case not accounted for by the regex).
@Obong You are not supposed to use a class selector. As I already explained the fact that you can pass the challenge using a class selector is just a bug.
If and when you are supposed to use a class selector in a challenge it will be very clear about it and will (should) include instructions for adding the class to the element as well.