Saturday, 11 March 2023

HTML Base Tag

 

HTML <base> tag

HTML <base> tag is used to specify a base URI or URL to use for all relative links contained within an HTML document.

Only one <base> element can be specified within a document, and it must be placed within <head> element. We can also specify how other links should open (in the same window, in another window, etc.) using the target attribute.

Syntax

  1. <base href="https://www.javatpoint.com">  

In HTML <base> element does not contain closing tag but in XHTML end tag </base> is required.

Following are some specifications about the <base> tag

DisplayNone
Start tag/End tagOnly start-tag
UsageAnchors and links

Example

<html>
<head>
        <base href="/D:images" target="_blank">
<meta charset="UTF-8">
<title></title>
</head>
<body>
<img src="1.jpg">
       <img src="2.jpg">
       <img src="3.jpg">
</body>
</html>


No comments:

Post a Comment

Full Form of IT and ITes Industry

                                                 Full Form (IT and ITeS) ICT - Information Communication Technology IT - Information Tec...