относительный против абсолютного пути HTML

Relative path: 
<img src="dog.png">
<!-- 
a local file relative to where the html is on a computer or server
-->

Absolute path: 
<img src="http://yourdomain.com/images/example.png">
<img src="//yourdomain.com/images/example.png">
<!-- 
full URL path
-->

Great stack overflow answer:

<!-- 
URLs including scheme (e.g. http / https) and the hostname (e.g. yourdomain.com) shouldn't be used (for local resources) because it will be terrible to maintain and debug.

Let's say you have used absolute URL everywhere in your code like <img src="http://yourdomain.com/images/example.png">. Now what will happen when you are going to:

switch to another scheme (e.g. http -> https)
switch domain names (test.yourdomain.com -> yourdomain.com)
In the first example what will happen is that you will get warnings about unsafe content being requested on the page. Because all your URLs are hardcoded to use http(://yourdomain.com/images/example.png). And when running your pages over https the browser expects all resources to be loaded over https to prevent leaking of information.

In the second example when putting your site live from the test environment it would mean all resources are still pointing to your test domain instead of your live domain.

So to answer your question about whether to use absolute or relative URLs: always use relative URLs (for local resources).

This is how to structure absolute URLs with scheme:
//yourdomain.com/images/example.png

This URL is relative based on the current scheme used and should almost always be used when including external resources (images, javascripts etc).

What this type of URL does is use the current scheme of the page it is on. This means that you are on the page http://yourdomain.com and on that page is an image tag <img src="//yourdomain.com/images/example.png"> the URL of the image would resolve in http://yourdomain.com/images/example.png.
When you would have been on the page http**s**://yourdomain.com and on that page is an image tag <img src="//yourdomain.com/images/example.png"> the URL of the image would resolve in https://yourdomain.com/images/example.png.

This prevent loading resources over https when it is not needed and automatically makes sure the resource is requested over https when it is needed.
-->
QuietHumility