Many people have this confusion of understing URL but most people thinks its too late. When i move to web development i had no idea of internals as i just assumed that things magically worked out. I think its better to learn the basics to get more grip on terms and infrastructure for better understanding.
So lets see a URL
So lets see the differnet part of this URL.
http:// is the URL scheme. Meanning how we will access the web page.
www.food.com Next is the host name. You can also have IP address here but its really hard for people and business to remember the IP address of a web page so there is a user friendly name. In this case the food.com is the host name. When you make this request the DNS (Domain name server) will resolve (get information related to that domain ) the domain name and route you to the address of that domain.
80 This is the port number. You might be thinking that this information is not really added in all the URLs that you usualy have so whaty do you need it here. This is the default port on which the server is listning to all the http requests. If you dont specify it the browser will internally add it. If you have any other port you can specify that externally and the browser will work accordingly.
local/street/food this is the path. indicating where you want to go on the web site. In this case i want to go to local directory and street and the the page food.
#/carrot The last bit is the fragment Its not always that it could be the name of the resource that we want to access or some html or any other page. In this case it means that on food page go to the carrot part of the page (which could be by the end of the page) so when you open the page you will be automatically redirected to the end of the page.