Etichetta HTML <basefont>

Non supportato da HTML5.

<basefont> Il tag è utilizzato in HTML 4 per definire il colore predefinito del testo, la dimensione del font o la famiglia del font per tutti i testi del documento HTML.

Cosa sostituire?

Esempio 1

Colore predefinito del testo della pagina (utilizzando CSS):

<html>
<head>
<style>
body {
  color: red;
}
</style>
</head>
<body>
<h1>Questo è un titolo</h1>
<p>Questo è un paragrafo.</p>
</body>
</html>

Prova personalmente

Esempio 2

Famiglia predefinita del font della pagina (utilizzando CSS):

<html>
<head>
<style>
body {
  font-family: courier, serif;
}
</style>
</head>
<body>
<h1>Questo è un titolo</h1>
<p>Questo è un paragrafo.</p>
</body>
</html>

Prova personalmente

Esempio 3

Dimensione predefinita della pagina del font (utilizzando CSS):

<html>
<head>
<style>
body {
  font-size: 50px;
}
</style>
</head>
<body>
<h1>Questo è un titolo</h1>
<p>Questo è un paragrafo.</p>
</body>
</html>

Prova personalmente

Suggerimento:Nel nostro corso CSS, puoi ottenere informazioni su Colore del testo CSS e Caratteri CSS per ulteriori informazioni.