base element, optional
The base element is optional.
1 2 3 4 5 6 7 8 9 10 | <!doctype html> <> <> <>... <⁄> <> <⁄> <> <⁄> <⁄> |
1 2 3 4 5 6 7 8 9 10 | <!doctype html> <> <> <>... <⁄> <⁄> <> <⁄> <⁄> |
Video demonstration base, optional element
HTML5 base, optional element, Tutorial
min | video details |
---|---|
00:02 | open html demo file in Notepad++ |
00:06 | base tag is present in head section, but since is optional we can remove it and rework the affected relative urls in page |
00:14 | for example purpose, we will comment the base line instead of deleting it completely |
00:23 | the base url points toward a folder called "optional" |
00:29 | except index.php page all other resources are located inside this folder, like: the css file, images, the linked.php file |
00:36 | note: in page the path of those resources doesn't indicate the "optional" folder because it is contained in the base url |
00:49 | but since the base element will be remove soon, we need to add manually this "optional" folder to each resource referred through a relative url |
00:59 | the base tag also sets a default browsing context: a blank new one |
01:04 | since we ill remove the base element, this default browsing context will no longer be applied → we will add it manually to each resource in page which could require a browsing context |
01:13 | reworked finished: this is how the page looks like without the base tag, while maintaining the same display ⁄ functionality |
01:14 | base tag can now be removed completely from page |