base is an empty element, which means that it does not have any content. However it does have attributes. It is only found in the head element. This element must appear before any element that contains URLs.
Attributes
hrefThis is a required attribute whose value is a URL which is added on to all relative URLs in the document. The url specified must end with a forward slash. Note that the base url specified affects all relative URLs - those contained in
<link>,<form>,<a>,<img>,<iframe>, etc.Example 1:
<base href="http://destination-code.blogspot.com/" />Example: 2
<base href="/pages/" />targetAll links in the page (
<a>elements) load in a new window with the internal name specified intarget.Example:
<base href= "/images/" target="_blank" />Note that the default target can be overridden by the
targetattribute in anatag.



No comments:
Post a Comment