+ 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 😑

5th Aug 2017, 5:05 PM
Jomzkie
Jomzkie - avatar
2 odpowiedzi
+ 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.
5th Aug 2017, 5:20 PM
💞ⓢⓦⓐⓣⓘ💞
💞ⓢⓦⓐⓣⓘ💞 - avatar
+ 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
5th Aug 2017, 7:55 PM
MCJEH
MCJEH - avatar