W3docs

Etiqueta HTML <basefont>

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.

La etiqueta <basefont> especifica el tamaño y color de fuente predeterminados del texto. Se puede usar varias veces dentro de las etiquetas <head> o <body>.

danger

La etiqueta <basefont> es una etiqueta HTML obsoleta y no está soportada en HTML5.

Sintaxis

La etiqueta <basefont> es vacía, lo que significa que no se requiere la etiqueta de cierre. Sin embargo, en XHTML, la etiqueta (<basefont>) debe cerrarse (<basefont/>).

Ejemplo de la etiqueta HTML <basefont>:

<!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

Para lograr el comportamiento anterior de <basefont>, utiliza las propiedades CSS font, font-family, font-size y color.

Ejemplo de la etiqueta HTML <basefont> con propiedades CSS:

<!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>

Resultado

ejemplo de basefont

Atributos

AtributoValorDescripción
colorcolorEstablece el color de texto predeterminado. No soportado en HTML5.
facefont_familyDefine la fuente del texto. No soportado en HTML5.
sizenumberEspecifica el tamaño de la fuente. No soportado en HTML5.

Práctica

Práctica

¿Qué es cierto sobre la etiqueta HTML &lt;basefont&gt;?