Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE
     ❯   

HTML <base> href Attribute

❮ HTML <base> tag

Example

Specify a base URL for all relative URLs on a page:

<head>
  <base href="https://w3.p2hp.com/images/">
</head>
Try it Yourself »

Definition and Usage

The href attribute specifies the base URL for all relative URLs on a page.


Browser Support

Attribute
href Yes Yes Yes Yes Yes

Syntax

<base href="URL">

Attribute Values

Value Description
URL An absolute URL that acts as the base URL (like "http://www.example.com/")

❮ HTML <base> tag