Base Tag in HTML- How to set all links target with a common tag, What is the use of Base Tag in HTML


Base Tag in HTML- How to set all links target with a common tag, What is the use of Base Tag in HTML

The Base Tag is used to set a common URL to all the links specified in a web page. If we want to set all links will open in new window then we have to define it in <base> tag.

Example:-

<head>
<base href="w3stutorial.blogger.com" target="_blank"  >
</head>
<body>
<a href="w3stutorial.blogger.com">click to open this in new tab or window</a>
</body>
</html>

in above example there is no target attribute define in <a> tag but this link will open in new window or tab.

{ 0 comments... read them below or add one }

Post a Comment