+ 1
What is <base> element?
I saw this element at challenges. Obviously I answered wrong, then I tried to search on google the answer but it dont satisfy my needs. so plss tell me more about this element 😑
2 Respuestas
+ 4
This post is part of a series called Strange and Unusual . ... The <> tag in is a relatively little known , having become a fully fledged part of HTML5 quite recently. It enables you to do two things: Set any URL you choose as the for all relative URLs. Set default link targets.
+ 4
let's say ur working on multiple html projects, u have a folder for each and instead of writing the full file path in ur html like an image src, external css or a link u could set the base elements href as the current projects folder path
<base href="file:///C:/HTML Projects/Project A/" target="_blank">
then u can add files to ur html without always putting the full file path
all files with start with the base tags file path then whatever file ur trying to access
<a href="page-2.html> next page</a>
<img src="images/logo.jpg" alt="Logo" />
(assuming u have a folder in ur project folder named "images")
this way ur html looks less messy with long file paths