base href Attribute - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:base

Description

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

Attribute Values

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

The following code shows how to Specify a base URL for all relative URLs on a page:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
  <base href="http://java2s.com/resources/">
</head><!--from  w w  w . ja  v a 2  s  .c o m-->
<body>

<p><img src="a.gif" width="24" height="39" alt="message"></p>

</body>
</html>

Related Tutorials