Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

<base>

Перевод не завершен. Пожалуйста, помогите перевести эту статью с английского.

HTML <base> элемент определяет основной URL используемый для всех относительных URLs содержащихся в документе. Может быть только один <base> элемент в документе. 

Основной URL документа может быть запрашиваем из скрипта используя document.baseURI.

Usage Note: If multiple <base> elements are specified, only the first href and first target value are used; all others are ignored.
Content categories Metadata content.
Permitted content None, it is an empty element.
Tag omission There must be no closing tag.
Permitted parent elements Any <head> that doesn't contain any other <base> element
DOM interface HTMLBaseElement

Attributes

This element includes the global attributes.

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.
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.

Examples

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

Specifications

Specification Status Comment
WHATWG HTML Living Standard
Определение '<base>' в этой спецификации.
Живой стандарт No change since last snapshot.
HTML5
Определение '<base>' в этой спецификации.
Рекомендация Specified the behavior of target
HTML 4.01 Specification
Определение '<base>' в этой спецификации.
Рекомендация Added the target attribute

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support (Да) 1.0 (1.7 или ранее) [1] (Да) [2] (Да) (Да)
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support (Да) 1.0 (1.0) [1] (Да) (Да) (Да)

[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

Метки документа и участники

 Внесли вклад в эту страницу: coollibins
 Обновлялась последний раз: coollibins,