HTML and CSS Reference
In-Depth Information
6.7.1.2. The target attribute
When working with documents inside frames, the target attribute with
the <a> tag ensures that a referenced URL gets loaded into the correct
frame. Similarly, the target attribute for the <base> tag lets you establish
the default name of one of the frames or windows in which the browser
is to display redirected hyperlinked documents. [ An Overview of Frames,
11.1 ]
If you have no other default target for your hyperlinks within your
frames, you may want to consider using <base target=_top> . This en-
sures that links that are not specifically targeted to a frame or window
will load in the top-level browser window. This eliminates the embar-
rassing and common error of having references to pages on other sites
appear within a frame on your pages, instead of within their own pages.
A minor bit of HTML, to be sure, but it makes life much easier for your
readers.
6.7.1.3. Using <base>
The most important reason for using <base> is to ensure that any relative
URLs within the document will resolve into correct document addresses,
even if the documents themselves are moved or renamed. This is par-
ticularly important when creating a document collection. By placing the
correct <base> tag in each document, you can move the entire collection
between directories and even servers without breaking all of the links
within the documents. You also need to use the <base> tag for a search-
able document ( <isindex> ) if you want user queries posed to a URL dif-
ferent from that of the host document.
A document that contains both the <isindex> tag and other relative URLs
may have problems if the relative URLs are not relative to the desired
index-processing URL. Because this is usually the case, don't use relat-
ive URLs in searchable documents that use the <base> tag to specify the
query URL for the document.
 
Search WWH ::




Custom Search