The usage of '#'


#1


I just noticed something I couldn't understand. What is the usage of '#'? Is it a shortcut to refer the previously mentioned webpage? Or does it have another meaning?


Replace this line with your code. 
url("https://s3.amazonaws.com/codecademy-content/courses/web-101/unit-8/htmlcss1-img_bicycles.jpeg")

url('#')


#2

This is known as a hash, and is the last part of an URL.

protocol
host
path
file
query
hash

When it is the only character in the string, it refers to the current address in the location bar (the webpage you are on). such a link will only scroll the page to the top if is not already there.

When followed by more characters, that is an id attribute of an element (or page fragment) in the page. Clicking a link with that in it will scroll the page so that element is above the fold, and its top line at the top of the window.


This is way out of the park, but you will find it interesting in months or years to come...

A regular expression to validate a URL

I found this link in the following article...

https://ponyfoo.com/articles/tc39-ecmascript-proposals-future-of-javascript

Again, this is very removed from what you are doing so please do not let yourself get segued. Bookmark this topic with a useful name, like 'RegExp URL example' so you can find it later. The subject is far too removed to explore at this time.


#3

I get it now. Thank you


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.