link kinda describes the idea... what you are dealing with is absolute vs relative paths (in your case you are doing relative)... I always find this to be a pain in the ***, and I have never cared to 'learn it'... I know the concept behind it, but what I do is (if) I am starting a new project, I get the skeleton working first with my master page and all the children, and then go to work on the rest of the site. Once you understand the theory behind it you can either learn it, or fiddle with it from time to time as I do.
basically it boils doen to this...
absolute paths (which you are not using) would be something like this
As you can see they are hard coded paths. These are generally less favorable as they require the server to be exactly as coded (hard coded values can cause a lot of problems)
then there are relative paths which looks like
See the difference? They rely on the projects structure not the box they are sitting on, so they will always be right (also relative has forward slashes */* as opposed to absolute's backslashes *\*). Old Pedant may be able to clarify the technicalities of the dot's and slashes (again I never care to 'learn' them, I just spend the few minutes tinkering with them- but I also don't do a lot of front end work either :P)
hope that helps some