Home > Mobile >  HTML css/js 'import' path resolution
HTML css/js 'import' path resolution

Time:10-05

A long time ago I made a multi-sub-domain project which all used the same files. I hosted the contents on a cdn. sub-domain. On all of the other sub-domains I just loaded the css/js files with relative file paths (ex. /assets/css/style.css, /assets/js/script.js) and I had a <meta> or <link> tag (iirc) in the <head> of the page with an attribute that basically tells the browser to load the files from the domain specified (which in this case is the cdn. subdomain) instead of the current domain.

My question is, which was the HTML tag and attribute for this action. I cant seem to find it, and i dont remember what it was called.

CodePudding user response:

<base href="https://cdn.example.com">

Documentation: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base

CodePudding user response:

The HTML tag I was looking for is <base>

  • Related