HTML CSS examples for HTML Tag:base
The href attribute sets the base URL against which relative URLs in the rest of the document will be resolved.
Using the href Attribute in the base Element
<!DOCTYPE html> <html> <head> <base href="http://java2s.com/"> </head> <body> <p> I like <code id="myId">HTML</code> and CSS. <!-- ww w . j a va2 s . c o m--> </p> <a href="index.htm">Visit java2s.com</a> <a href="page2.html">Page 2</a> both index.htm and page2.html will be resolved to http://java2s.com/index.htm and http://java2s.com/page.html, respectively. </body> </html>