Html5 Base Tag

The html base tag is used to indicate for relative Url or links. The base tag must be inside of head element.example once you can set base url at top place of inside head tag you can use that base url in current page.Maximum one <base> element should be in a document or form.

Syntax:

<html>
   <head>
   <base href="..." />
   </head>
</html>

Example Code

<!DOCTYPE HTML>
<head>
  <base href="http://www.tutorialsscripts.com/html5-tutorials/" target="_blank" />
</head>
<body>
   <p>Learn about <a href="html5-what-is.php">Html5 What is</a> </p>
   <p>Learn about <a href="tag/video.php">Html5 Video </a> </p>
   <p>Learn about <a href="tag/audio.php">Html5 Audio </a> </p>
</body>

Out Put :



Learn about Html5 What is

Learn about Html5 Video

Learn about Html5 Audio

In the above example Learn about Html5 What is,Learn about Html5 Video and Learn about Html5 Audio are html5 tutorial link.In this three link base end will be linked to <a> tag and it base url contain at inside head element.





Content