base target Attribute - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:base

Description

The target attribute sets the default target for all hyperlinks and forms in the page.

Attribute Values

Value Description
_blankOpens the link in a new window or tab
_self Default. Opens the link in the same frame as it was clicked
_parent Opens the link in the parent frame
_top Opens the link in the full body of the window
framename Opens the link in a named frame

The following code shows how to set a default target for all hyperlinks and forms on a page:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
  <base target="_blank">
</head><!--   w  ww  .  java 2 s  .  c o m-->
<body>

<p><a href="http://java2s.com">java2s.com</a> a link</p>

</body>
</html>

Related Tutorials