HTML and CSS Reference
In-Depth Information
base element), images and other embedded media, inline frames with src attributes, forms with action
attributes, and so on. The base element effectively rewrites every document-relative URL that follows it.
Base target
If the base element has a target attribute, the attribute's value is a name or keyword indicating the
default location (a window, tab, or inline frame) where results are displayed when hyperlinks or forms in
the document cause navigation. If the target is the name of a window or frame, any links in the document
will display their results within that named window or frame. If the target name doesn't match any existing
browsing context—if no window or frame exists by that name—links and forms will load their results in a
new window instead.
In place of a target name, some reserved keywords (complete with their leading underscores) have special
meanings:
self : Loads the result into the same browsing context as the current one. This is the default if the
target attribute isn't specified, or if the base element is missing altogether. In other words, this is
how links and forms behave normally.
blank : Loads the result into a new, unnamed browsing context (a new browser window or tab).
parent : Loads the result into the parent browsing context of the current one. If there is no parent,
this option behaves in the same manner as _self .
top : Loads the result into the top-level browsing context, which is the window or inline frame that
is an ancestor of the current one but has no parent of its own. If there is no parent, this option
behaves in the same manner as _self .
You could, for example, declare that every link in your document should open in a new, blank window (or
tab, if the browser is set to open tabs instead of windows):
<base target="_blank">
But that could be downright abusive to your visitors and there aren't many cases where it would be useful
or justified. A more practical use case might be in a page intended for display within an inline frame (the
iframe element is covered in Chapter 4) where any links within that document should open in the parent
window rather than inside the frame:
<base target="_top">
Optional Attributes
The base element doesn't offer any other optional attributes apart from the global attributes that apply to
all elements.
 
Search WWH ::




Custom Search