SyntaxStudy
Sign Up

<base>

tag

Specifies the base URL and/or target for all relative URLs in a document.

Syntax

<base href="https://example.com/" target="_blank">

Example

html
<head>
    <base href="https://www.example.com/">
</head>
<body>
    <!-- This resolves to https://www.example.com/images/logo.png -->
    <img src="images/logo.png" alt="Logo">
    <!-- This resolves to https://www.example.com/contact -->
    <a href="contact">Contact</a>
</body>