Does line spacing matters for CSS and HTML?
When I save on VS Code it auto formats the code like that, so I’m developing a habit of pressing enter after every completely line, but on FCC, the lesson doesn’t progress unless there are no spaces. Hence, my question.
[FCC code]
article class=“item”
(<)p class=“dessert”>Donut</p(>)p class=“price”>1.50</p(>)
/article
[VSC code]
article class=“item”
(<)p class=“Dessert”>donut</p(>)
(<)p class=“price”>1.50</p(>)
/article
Hi there!
Welcome to the FCC forum. The FCC challenge editor is also organized your code after each challenge step is submited. Try to pass the challenge step with your own free style coding and check it letter.
Edit: the FCC curriculum was previously shows that in one of the cat photo app
challenge step , that how to indent your line of codes.
Welcome to the forum @DesuWRLD
The tests on freeCodeCamp check for specific characters, and anything extra like spaces or line breaks may fail the tests.
So although the code is valid, it could still fail the fCC tests.
Happy coding
If the dessert
and price
elements are inline/inline-block elements, adding a space (or new line) will create a space on the page between the two elements. If that isn’t expected or intended, the new line code formatting would be wrong.
For future reference:
When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>
) to add backticks around text.
See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').