Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP PHP Arrays and Control Structures PHP Arrays Multidimensional Arrays

Keith Colleluori
Keith Colleluori
9,577 Points

Why does using <br> or just the <li> elements fail? The output is exactly the same on my screen afaik, as \n

I do not think I understand what \n does. Every time I encounter it, it seems to trip me up. As I said in the heading, when I made the material appear the same using, html <br> or the <li> with no \n or <br> I failed. Even though it appears exactly the same as far as I could tell it didn't pass.

What is \n telling me? Is it a new line for coding, and not for output? Is that what I am not getting?

1 Answer

Filipe Pacheco
seal-mask
.a{fill-rule:evenodd;}techdegree
Filipe Pacheco
Full Stack JavaScript Techdegree Student 21,416 Points

The \n will add a line break to the source code output, and <br> tag will add a line break to the resulting visual display. So the \n will not work in the browser, but if you try to view the page source or run the file on a terminal, you will see that it works.