HTML HTML Basics Going Further with HTML Link to Email

maya sophie
maya sophie
5,754 Points

the use of %20 !!! why we have to right down space using "%20" when we can simply let some space there ?

example: "Hi%There" vs "Hi There". Why do we have to use that sign? I tried both and the result is the same.Question: why do we have to complicate the situation with all kind of signs....amp&...etc

maya sophie
maya sophie
5,754 Points

I mean "write" not "wright"...I'm a bit sick..sorry

maya sophie
maya sophie
5,754 Points

write not right....still sick

1 Answer

Michael Hulet
MOD
Michael Hulet
Treehouse Moderator 47,724 Points

URLs are percent-escaped, which means that if there's a special character (like a space) which different browsers might interpret differently, you must replace them in the URL with these special percent sequences. For example, in Safari and Chrome on my machine, if I use just a normal space in a URL instead of %20, it will interpret my entry as a Google Search and not actually take me to the website I was trying to go to. You can read more about percent encoding and find lots of common codes on its Wikipedia page

HTML entities like & serve a very similar purpose in a different context. Many old browsers interpret HTML as ASCII, which has a very limited possible set of characters. An HTML entity is a sequence that represents a character that's not necessarily in the character encoding that the page uses. In most cases nowadays, you can type the character itself and all browsers will know what you mean just fine, but for the sake of correctness and supporting old browsers, it's good to use HTML entities instead of just the characters themselves. The W3C has a full list of possible HTML entities