XML technologies / HTML & XHTML / Alphabetical list of HTML and XHTML elements / base

(Excerpt from "HTML & XHTML ─ kurz & gut" by Jennifer Niederst Robbins)

A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z

   

HTML 4.01 | HTML 5

base

HTML: <base>; XHTML: <base/> or <base />

Defines the base path for all relative URLs in the document. The element base must be placed in the head (<head>) of the document.

Start/end tag

This is an empty element. HTML forbids an end tag. In XHTML, the element must end with a slash before the closing angle bracket. Developers can insert a space before the slash to improve backward compatibility with older browsers.

Attributes

  • href="URI"

    Required in HTML 4.01. Specifies the absolute URL to use as the base URL for resolving relative links in the document.

  • id="Text"

    XHTML and HTML 5 only. Assigns an ID that uniquely identifies the element.

  • target="Name"

    Defines the target window for all links in the document.

 

Example (HTML)

<head>
  <title>Beispieldokument</title>
  <base href="http://www.example.com/stories/">
</head>

Example (XHTML)

<head>
  <title>Beispieldokument</title>
  <base href="http://www.example.com/stories/" />
</head>

 

> back to the alphabetical list of elements

   

 

 

 

back to top