HTML

RELATIVE ABSOLUTE URL & HTML BASE TAG

ABSOLUTE URL A “full website address”. For example, http://site.com/assets/img.jpg

ABSOLUTE VS RELATIVE URL

01

RELATIVE URL A partial website address”. For example, assets/img.jpg  Based on current address. If current URL is http://site.com/abc/, this will resolve to http://site.com/abc/assets/img.jpg

MUST BE IN <HEAD> SECTION <head>   <base href="http://site.com/assets/"> </head>

HTML BASE TAG

02

http://site.com/assets/img.jpg  <img src="img.jpg"/>  http://site.com/assets/vid.mp4 <video src="vid.mp4"></video>  http://site.com/assets/sound.mp3 <audio src="sound.mp3"></audio> http://site.com/assets/foo.html <a href="foo.html">Link</a>

OVERRIDE BASE TAG

03

http://site.com/assets/foo.html <a href="foo.html">Link</a>  JUST USE ABSOLUTE URL  http://site.com/foo.html <a href="http://site.com/foo.html">Link</a>