Challenge Prioritize One Style Over Another has an issue.
User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:39.0) Gecko/20100101 Firefox/39.0
.
Please describe how to reproduce this issue, and include links to screenshots if possible.
My code:
<style>
body {
background-color: black;
font-family: Monospace;
color: green;
}
.pink-text{color:pink}
</style>
<h1 class="pink-text">Hello World!</h1>
Because the attribute "color:pink" was not followed by a semicolon, the challenge was not successful.
It works in other challenges.
@Yemeni, Sorry this is not issue. you forget to add semicolon.
@Yemeni Hmm the semi-colon in a single CSS rule isn't necessary. I guess we could relax the regex to allow the option of putting the semi-colon. It appears to already be relaxed in Style the HTML Body Element.
@FreeCodeCamp/issue-moderators second opinion?
We discussed this in https://github.com/FreeCodeCamp/FreeCodeCamp/issues/8005. Should we reconsider?
@sludge256 well @BerkeleyTrue has spoken on these rules. I personally would add semi-colons to my CSS for consistency. Considering our target audience are beginner programmers, I agree we should enforce this best practice. Maybe we should also change the test in Style the HTML body Element to require the semi-colon too.
@erictleung @sludge256 Yes, semicolons should always be included for consistency.
@Yemeni closing this issue as the semicolon should be required to complete the challenge. Happy coding!
Most helpful comment
@sludge256 well @BerkeleyTrue has spoken on these rules. I personally would add semi-colons to my CSS for consistency. Considering our target audience are beginner programmers, I agree we should enforce this best practice. Maybe we should also change the test in Style the HTML body Element to require the semi-colon too.