And we got another Q&A video for you and this one is going to be talking about something that you may
have seen yourself while following along these videos and that is the fact that this file over here
is different than let's say if you go to a Web site and you see 'https'- what does that mean?
If you go into our example you also saw here that we have an anchor tag that references a 'newpage.html'
that has nothing like 'file' or 'http' in front of it.
And then you also saw that the images here are referencing some sort of a website that links to a picture.
So what's the difference here? The difference here is that the first is using the file protocol and that
means that this web-page -
I can't really access it outside of my computer.
This is using something called a relative path.
If I go into my 'index.html' I am saying to link to 'newpage.html' relative to where
'index.html' is.
So if we go to our desktop you see that 'index.html'
lives in the same directory, which is the desktop, as 'newpage.html'.
So I can reference it through here. If I created a new folder or let's say, "test" I would have to reference
it this way.
So let's let's check here.
If I save this and go into the web-page refresh and click "New Page" I'll get "Your file was not found."
But now if I go into my desktop and create "test" and I put the new page in here and let's bring back
everything refresh and click on new page,
this is now working.
And you can see over here that I'm accessing it through "Desktop/test/newpage.html".
So that's called a relative path.
So relative to where 'index.html' page is I am saying, " 'index.html',
I want to access from 'test/newpage.html' ".
If you look at the images you'll see that we have something different.
We're accessing the image through http, which we'll get into into later videos when we talk about
servers but this is how we access files over the internet.
If I wanted this anchor tag, this 'New Page' to actually link to something, maybe another website, maybe
to this hilarious gif. Well I can copy this link, open up my Sublime Text, and now I can just copy this
with the https protocol.
And now this is an absolute link. No matter where I reference this -
if I put it into 'newpage.html', or 'index.html', no matter what, this link will get me to this
gif.
So let's test that out:
I save this, I refresh, and I click on 'New Page', and look at that.
We have the gif.
Hopefully that answers your question.
We'll get into http, and https later on in the course.
But for now keep that in mind, that there is absolute path and then there is relative path - going to fix that,
so we have it back for the next video.
I'll see on the next one.
Bye-bye