Please visit our sponsors !
The <base /> tag
Definition and Usage
The base element specifies a base URL for all the links in a page.
Tips and Notes
Note: The <base /> tag must go inside the head element.
Example
Assume that the absolute address for an image is:
| <img src="http://www.w3schools.com/images/smile.gif" />
|
Now we insert the <base> tag, which specifies a base URL for all of the
links in a page, in the head section of a page:
<head>
<base href="http://www.w3schools.com/images/" />
</head> |
When inserting images on the page in the example above, we just have to specify the
relative address, and the browser will look for that file using the full URL,
"http://www.w3schools.com/images/smile.gif":
Required Attributes
DTD indicates in which XHTML 1.0 DTD the attribute is
allowed. S=Strict, T=Transitional, and F=Frameset.
| Attribute |
Value |
Description |
DTD |
| href |
URL |
Specifies the URL to use as the base URL for links in the
page |
STF |
Optional Attributes
| Attribute |
Value |
Description |
DTD |
| target |
_blank
_parent
_self
_top |
Where to open all the links on the page. This attribute can be overridden by
using the target attribute in each link.
- _blank - all the links will open in new windows
- _self - all the links will open in the same frame they where clicked
- _parent - all the links will open in the parent frameset
- _top - all the links will open in the full body of the window
|
TF |
Standard Attributes and Events: NONE
Jump to: Top of Page
or HOME or
Printer friendly page
Search W3Schools:
What Others Say About Us
Does the world know about us? Check out these places:
Dogpile
Alta Vista
MSN
Google
Excite
Lycos
Yahoo
Ask Jeeves
We Help You For Free. You Can Help Us!
W3Schools is for training only. We do not warrant its correctness or its fitness for use.
The risk of using it remains entirely with the user. While using this site, you agree to have read and accepted our
terms of use and
privacy policy.
Copyright 1999-2002 by Refsnes Data. All Rights Reserved
|