HTML Basics

HTML Introduction HTML Basic HTML Comments HTML Tags/Elements HTML Attributes HTML Formatting HTML Block and Inline HTML Charsets HTML Classes HTML Colors HTML Div HTML Headings HTML Id HTML Iframes HTML Images HTML File Paths HTML Tables HTML Layout HTML Lists HTML Links <a> HTML Paragraphs HTML Quotations HTML JavaScript HTML Emojis HTML URL Encode HTML Entities HTML Computercode HTML Symbols HTML Styles

HTML Forms

HTML Forms HTML Form Elements HTML Form Attributes HTML Input Attributes HTML Input Regex HTML Input Form Attributes HTML Input Types

HTML SEO

HTML Head HTML Page Title HTML Responsive HTML Semantics HTML Favicon

HTML Graphics

HTML Canvas HTML SVG

HTML Media

HTML Media HTML Audio HTML Video

HTML Reference

a abbr acronym address applet area article aside audio b base basefont bdi bdo big blockquote body br button canvas caption center cite code col colgroup data datalist dd del details dfn dialog dir div dl DOCTYPE dt em embed fieldset figcaption figure font footer form frame frameset h1_-_h6 head header hgroup hr html i iframe img input ins kbd label legend li link main map mark menu meta meter nav noframes noscript object ol optgroup option output p param picture pre progress q rp rt ruby s samp script search section select small source span strike strong style sub summary sup svg table tbody td template textarea tfoot th thead time title tr track tt u ul var video wbr

HTML <basefont> Tag Tutorial

The <basefont> tag is used to specify the base font size, color, and face for text in an HTML document. This tag is no longer supported in HTML5, so it is recommended to use CSS for styling fonts instead. However, it is still useful to understand how this tag works for legacy purposes.

Usage of <basefont> Tag

The <basefont> tag is placed within the <head> section of an HTML document. It can have three attributes: size, color, and face. These attributes allow you to set the default font properties for the entire document.

Attributes of <basefont> Tag

Attribute Description
size Sets the base font size. The value can be a number ranging from 1 to 7, with 3 being the default size.
color Sets the base font color. The value can be a color name or a hexadecimal value.
face Sets the base font face. The value can be a font family name or a generic font family.

Example:

Consider an example where we set the base font size to 5, color to red, and face to Arial.


<head>
  <basefont size="5" color="red" face="Arial">
</head>

With this <basefont> tag, the default font size, color, and face for the entire document will be set accordingly.

It is important to note that the <basefont> tag only affects text within the document that does not have explicit styling applied to it. Any text with specific font properties set using CSS will not be affected by the <basefont> tag.

Even though the <basefont> tag is no longer recommended for use in HTML5, understanding its functionality can help when dealing with older HTML documents that still use this tag for font styling.