--- title: HTMLBaseElement slug: Web/API/HTMLBaseElement tags: - 接口 translation_of: Web/API/HTMLBaseElement ---
{{APIRef("HTML DOM")}}
 

HTMLBaseElement 接口包含一份HTML文件的基础 URI设定,该对象继承了所有 {{domxref("HTMLElement")}} 接口中定义的方法与属性。

属性

继承了其父级 {{domxref("HTMLElement")}} 的所有属性

{{domxref("HTMLBaseElement.href")}}
映射自 {{domxref("DOMString")}}  HTML {{htmlattrxref("href", "base")}} 特性,包含了当前文档中所有相对 URL 地址的基准URL。
{{domxref("HTMLBaseElement.target")}}
Is a {{domxref("DOMString")}} that reflects the {{htmlattrxref("target", "base")}} HTML attribute, containing a default target browsing context or frame for elements that do not have a target reference specified.

方法

没有特殊的方法,继承了其父级 {{domxref("HTMLElement")}} 的所有特性。

Specifications

Specification Status Comment
{{SpecName('HTML WHATWG', "semantics.html#the-base-element", "HTMLBaseElement")}} {{Spec2('HTML WHATWG')}} No change from latest snapshot, {{SpecName("HTML5.1")}}.
{{SpecName('HTML5.1', "document-metadata.html#the-base-element", "HTMLBaseElement")}} {{Spec2('HTML5.1')}} No change from {{SpecName("HTML5 W3C")}}
{{SpecName('HTML5 W3C', "document-metadata.html#the-base-element", "HTMLBaseElement")}} {{Spec2('HTML5 W3C')}} No change from {{SpecName("DOM2 HTML")}}.
{{SpecName('DOM2 HTML', 'html.html#ID-73629039', 'HTMLBaseElement')}} {{Spec2('DOM2 HTML')}} No change from {{SpecName("DOM1")}}.
{{SpecName('DOM1', 'level-one-html.html#ID-73629039', 'HTMLBaseElement')}} {{Spec2('DOM1')}} Initial definition.

Browser compatibility

{{CompatibilityTable}}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support {{CompatVersionUnknown}} {{CompatGeckoDesktop(1.0)}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support {{CompatVersionUnknown}} {{CompatGeckoMobile(1.0)}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}

See also