Hello i am a newbie in web development. i am working on coding of a web page and stuck at this line:
<a href="/My_Story">My story</a>
might someone tell me what does forward slash means here i mean when i click my_Story
in (view-source-code of ff) it takes me to html coding of 'my story' similarly there are other links like
<a href="/Media">Media</a>
<a href="/Sponsors">Sponsors</a>
so when we click 'Media' or''Sponsors' i am taken to html coding of Media or Sponsors. How this is done?what the slash means?and why does the html code not appears directly WITHOUT clicking My_Story,Media or Sponsors.
Btw you may check the website : http://alexnoren.com/
Forward slash at the start of an
href
means that it's a relative path, starting from the root of the website.For example, in a page
example.com/folder/page.html
, anpoints to
example.com/folder/newpage.html
, whilepoints to
example.com/newpage.html
Can you explain better the source-code thing?
It means that the link will be pointing from the root folder
It means path from root of the site.
Examples: If you're in
http://example.com/folder/file.html
If page where link is appeared is in root itself (main page or page without slashes in path) it's no difference between link with slash and link without slash at all
This is what's known as a relative path. Including a forward slash
/
in the path means "go inside the folder written on the left of this slash" If there is nothing on the left, it treats the folder as the root of the website which in this case ishttp://alexnoren.com
.After taking a closer look at the alexnoren website it seems that it does not employ the method of navigation mentioned by myself and other people here. The page content is actually accessed through Javascript. When you click on the link you're not really moving to a different page at all, the
<a>
tags are triggering click event code and bringing content that is offscreen into view. If you disable javascript in your browser you'll see that it no longer works.