W3docs

HTML <basefont>-Tag

The <basefont> tag specifies the default font size and color of the text. It can be used several times inside the <head> or <body> tags. See examples.

Das <basefont>-Tag legt die Standardschriftgröße und -farbe des Textes fest. Es kann mehrmals innerhalb der <head> oder <body>-Tags verwendet werden.

danger

Das <basefont> ist ein veraltetes HTML-Tag und wird in HTML5 nicht unterstützt.

Syntax

Das <basefont>-Tag ist leer, was bedeutet, dass das schließende Tag nicht erforderlich ist. In XHTML muss das (<basefont>)-Tag jedoch geschlossen werden (<basefont/>).

Beispiel für das HTML <basefont>-Tag:

<!DOCTYPE html>
<html>
  <head>
    <title>Title of the documnet</title>
    <basefont color="green" face="Helvetica" size="14">
  </head>
  <body>
    <h3>Title of the text.</h3>
    <p>Paragraph of the text.</p>
  </body>
</html>

success

Um das frühere Verhalten von <basefont> zu erreichen, verwenden Sie die CSS-Eigenschaften font, font-family, font-size und color.

Beispiel für das HTML <basefont>-Tag mit CSS-Eigenschaften:

<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
    <style>
      body {
        color: #8ebf42; 
        font-size: 14px;
        font-family: Helvetica;
      }
    </style>
  </head>
  <body>
    <h3>Title of the text.</h3>
    <p>Paragraph of the text.</p>
  </body>
</html>

Ergebnis

basefont Beispiel

Attribute

AttributWertBeschreibung
colorFarbeLegt die Standardschriftfarbe fest. Wird in HTML5 nicht unterstützt.
faceSchriftfamilieDefiniert die Schriftart des Textes. Wird in HTML5 nicht unterstützt.
sizeZahlLegt die Schriftgröße fest. Wird in HTML5 nicht unterstützt.

Praxis

Übung

Was ist über das HTML &lt;basefont&gt;-Tag wahr?