Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML HTML Basics Going Further with HTML Link to Email

%20 vs.  

Is there a best practice rule for using %20 rather than a non-breaking space?

1 Answer

Steven Parker
Steven Parker
220,415 Points

Consider that %20 is just an ordinary space, expressed with URL encoding. It's not an HTML character entity code.

But   is a character entity code, and for "non-breaking space", which is different from a normal space in that it is treated for text-flow purposes as if it was a printing character.

So the choice between these should be easy as they have different practical uses, and are intended for different situations.