HTML <basefont>-Tag
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:
Grünes basefont|Grüner Textabsatz|Beispiel für das HTML <basefont>-Tag|W3Docs
<!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>TIP
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:
Früheres Verhalten von basefont|CSS-Schrifteigenschaften|Beispiel für das HTML <basefont>-Tag|W3Docs
<!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

Attribute
| Attribut | Wert | Beschreibung |
|---|---|---|
| color | Farbe | Legt die Standardschriftfarbe fest. Wird in HTML5 nicht unterstützt. |
| face | Schriftfamilie | Definiert die Schriftart des Textes. Wird in HTML5 nicht unterstützt. |
| size | Zahl | Legt die Schriftgröße fest. Wird in HTML5 nicht unterstützt. |
Praxis
Was ist über das HTML <basefont>-Tag wahr?