Znacznik HTML <baza>


Przykład

Określ domyślny adres URL i domyślny cel dla wszystkich linków na stronie:

<head>
  <base href="https://www.w3schools.com/" target="_blank">
</head>

<body>
<img src="images/stickman.gif" width="24" height="39" alt="Stickman">
<a href="tags/tag_base.asp">HTML base Tag</a>
</body>

Definicja i użycie

Tag <base>określa podstawowy adres URL i/lub cel dla wszystkich względnych adresów URL w dokumencie.

W <base>tagu musi być obecny atrybut href lub target albo oba te elementy.

W dokumencie może być tylko jeden <base>element i musi on znajdować się wewnątrz elementu <head>.


Obsługa przeglądarki

Element
<base> Yes Yes Yes Yes Yes

Atrybuty

Attribute Value Description
href URL Specifies the base URL for all relative URLs in the page
target _blank
_parent
_self
_top
Specifies the default target for all hyperlinks and forms in the page

Globalne atrybuty i wydarzenia

Znacznik <base>obsługuje również atrybuty globalne w HTML .


Atrybuty wydarzenia

 Tag <base>nie obsługuje żadnych atrybutów zdarzenia.


Powiązane strony

Dokumentacja HTML DOM: Obiekt podstawowy


Domyślne ustawienia CSS

Nic.