From da78a9e329e272dedb2400b79a3bdeebff387d47 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:17 -0500 Subject: initial commit --- files/id/web/html/element/base/index.html | 154 ++++++++++++++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 files/id/web/html/element/base/index.html (limited to 'files/id/web/html/element/base') diff --git a/files/id/web/html/element/base/index.html b/files/id/web/html/element/base/index.html new file mode 100644 index 0000000000..6b4a556381 --- /dev/null +++ b/files/id/web/html/element/base/index.html @@ -0,0 +1,154 @@ +--- +title: +slug: Web/HTML/Element/base +translation_of: Web/HTML/Element/base +--- +

{{HTMLRef}}

+ +

The HTML <base> element specifies the base URL to use for all relative URLs contained within a document. There can be only one <base> element in a document. 

+ +

The base URL of a document can be queried from a script using {{domxref('document.baseURI')}}.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Content categoriesMetadata content.
Permitted contentNone, it is an {{Glossary("empty element")}}.
Tag omissionThere must be no closing tag.
Permitted parentsAny {{HTMLElement("head")}} that doesn't contain any other {{HTMLElement("base")}} element
Permitted ARIA rolesNone
DOM interface{{domxref("HTMLBaseElement")}}
+ +

Attributes

+ +

This element's attributes include the global attributes.

+ +
+
{{htmlattrdef("href")}}
+
The base URL to be used throughout the document for relative URL addresses. If this attribute is specified, this element must come before any other elements with attributes whose values are URLs. Absolute and relative URLs are allowed.
+
{{htmlattrdef("target")}}
+
A name or keyword indicating the default location to display the result when hyperlinks or forms cause navigation, for elements that do not have an explicit target reference. It is a name of, or keyword for, a browsing context (for example: tab, window, or inline frame). The following keywords have special meanings: +
    +
  • _self: Load the result into the same browsing context as the current one. This value is the default if the attribute is not specified.
  • +
  • _blank: Load the result into a new unnamed browsing context.
  • +
  • _parent: Load the result into the parent browsing context of the current one. If there is no parent, this option behaves the same way as _self.
  • +
  • _top: Load the result into the top-level browsing context (that is, the browsing context that is an ancestor of the current one, and has no parent). If there is no parent, this option behaves the same way as _self.
  • +
+
+
+ +

Usage notes

+ +

If multiple <base> elements are specified, only the first href and first target value are used; all others are ignored.

+ +

Examples

+ +
<base href="http://www.example.com/page.html">
+<base target="_blank" href="http://www.example.com/page.html">
+
+ +

Specifications

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', 'semantics.html#the-base-element', '<base>')}}{{Spec2('HTML WHATWG')}}No change since last snapshot.
{{SpecName('HTML5 W3C', 'document-metadata#the-base-element', '<base>')}}{{Spec2('HTML5 W3C')}}Specified the behavior of target
{{SpecName('HTML4.01', 'struct/links.html#h-12.4', '<base>')}}{{Spec2('HTML4.01')}}Added the target attribute
+ +

Browser compatibility

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatGeckoDesktop("1.0")}} [1]{{CompatVersionUnknown}} [2]{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidEdgeFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatGeckoMobile("1.0")}} [1]{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +

[1] Support of relative URIs for href was added in Gecko 2.0 (Firefox 4.0)

+ +

[2] Before Internet Explorer 7, <base> could be positioned anywhere in the document and the nearest value of <base> was used. Support for relative URLs has been removed in Internet Explorer 8

-- cgit v1.2.3-54-g00ecf