🚀 LEVEL UP TO SENIOR:Unlock 500+ Advanced Practical Challenges & Exercises.
🎓 COURSERA PARTNER:Earn professional Google, Meta, and IBM certificates to supercharge your resume.
REFERENCEhtml

html Documentation

LOADING ENGINE...

<basefont>

AI & DATA SCIENCE // basefont-tag

The deprecated <basefont> element set a default font face, size, and color for all following text in a page; it has been fully removed in favor of CSS.

Syntax

<!-- Deprecated: -->
<basefont face="Arial" size="4" color="navy">
<!-- Modern equivalent: -->
<style>
  body { font-family: Arial; font-size: 1.2rem; color: navy; }
</style>

Deep Dive Course

**`<basefont>`** was an HTML 3.2-era element meant to set the default typography for everything after it on the page, without needing CSS. It was removed from the HTML5 spec, and modern browsers render it with no effect whatsoever — text keeps its normal default styling regardless of a `<basefont>` tag being present. Global typography today is set via CSS on the `body` selector (or a CSS custom property/design-token system), which is far more flexible, maintainable, and doesn't mix presentation into the document markup.

1Understanding <basefont>

`<basefont>` was an HTML 3.2-era element meant to set the default typography for everything after it on the page, without needing CSS. It was removed from the HTML5 spec, and modern browsers render it with no effect whatsoever — text keeps its normal default styling regardless of a <basefont> tag being present. Global typography today is set via CSS on the body selector (or a CSS custom property/design-token system), which is far more flexible, maintainable, and doesn't mix presentation into the document markup.

💡

If you see <basefont> in genuinely old HTML, it can simply be deleted — it has no effect in any browser released in the last two decades.

editor.html
<!-- Old, deprecated, and non-functional -->
<basefont face="Verdana" size="3">
<p>This text is unaffected by the basefont tag above.</p>
localhost:3000

2Practical Example

Here is a real-world application of <basefont> showing how it is used in production HTML.

editor.html
<!-- Correct modern replacement -->
<style>
  body { font-family: Verdana, sans-serif; font-size: 1rem; }
</style>
localhost:3000

3Best Practices

Follow these guidelines when working with <basefont>:

1. Never use <basefont> — it has no effect and is entirely removed from the spec

2. Set default typography via CSS on the body element or a global stylesheet

3. Delete any <basefont> tags found in legacy code — they're inert

⚠️

Tip: If you see <basefont> in genuinely old HTML, it can simply be deleted — it has no effect in any browser released in the last two decades.

editor.html
<!-- Old, deprecated, and non-functional -->
<basefont face="Verdana" size="3">
<p>This text is unaffected by the basefont tag above.</p>
localhost:3000

Examples

Example 01Basic Usage
<!-- Old, deprecated, and non-functional -->
<basefont face="Verdana" size="3">
<p>This text is unaffected by the basefont tag above.</p>
Example 02Advanced Example
<!-- Correct modern replacement -->
<style>
  body { font-family: Verdana, sans-serif; font-size: 1rem; }
</style>

Best Practices

  • Never use — it has no effect and is entirely removed from the spec
  • Set default typography via CSS on the body element or a global stylesheet
  • Delete any tags found in legacy code — they're inert

Interview Question

Does <basefont> have any visual effect in a modern browser like Chrome or Firefox?

Hint: Think about whether deprecated presentational tags always retain SOME visual effect, or can be entirely inert.

No — unlike some deprecated tags that still render with legacy default styling in modern browsers, <basefont> was removed from the HTML5 spec and current browsers give it no special treatment at all. Text on the page renders exactly as it would with the tag entirely absent, making it completely inert rather than merely 'discouraged'.

Exercises

EasyPractice using <basefont> in a real scenario.
View Solution
<!-- Old, deprecated, and non-functional -->
<basefont face="Verdana" size="3">
<p>This text is unaffected by the basefont tag above.</p>

Frequently Asked Questions

Does <basefont> have any visual effect in a modern browser like Chrome or Firefox?

No — unlike some deprecated tags that still render with legacy default styling in modern browsers, was removed from the HTML5 spec and current browsers give it no special treatment at all. Text on the page renders exactly as it would with the tag entirely absent, making it completely inert rather than merely 'discouraged'.

Related Functions

font-tag