I am huge fan of relative URLs. I am never sure about composition of my page so it helps moving it here and there.
Full URL looks like this:
https://user:pass@www.fantatec.com/path/path/document#location
We should not longer use user:pass@ in URL but note that @ and : character have their function already.
There is a bunch of relative URLs possible. Sadly no subdomain relative URL. Lets take a look.
Relative Urls
By location
Closest relative is location #by-location
Which requires adding id to some page elements.
One could consider adding id mark to every header in his page using a script.
Here is an example script which does it.
This will soon no longer be required as browsers starts to support linking by text lookup.
By lookup
Links to first "lookup" text in current page:
See full documentation for lookups: https://developer.mozilla.org/en-US/docs/Web/Text_fragments#syntax
By Path
By domain root
Relative to current domain, but search path starts from domain root.
By scheme/protocol
Can lead to different domain but using same protocol. Mainly to keep https or http.
Universe relative - absolute
The full url.
Subdomain relative
And we could do same for images.
Thanks for free graphics from:
https://www.vecteezy.com/members/vectoroartworks
Comments
Post a Comment