Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions content/html/concepts/tags/terms/basefont/basefont.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
Title: '<basefont>'
Description: 'Used to be used to set the font of text. This is now deprecated.'
Subjects:
- 'Web Development'
- 'Web Design'
Tags:
- 'Tags'
- 'Style'
- 'Typography'
CatalogContent:
- 'learn-html'
- 'paths/front-end-engineer-career-path'
---

The **`<basefont>`** tag was used to set the default font characteristics for the text of an HTML document. Since it is now deprecated, [CSS](https://www.codecademy.com/resources/docs/css) properties like the [`font` property](https://www.codecademy.com/resources/docs/css/typography/font) should be used instead. To set the font of specific parts of the webpage the [`<font>` tag](https://www.codecademy.com/resources/docs/html/tags/font) would be used in combination with the `<basefont>` tag.

## Syntax

The tag must be a child of the [head](https://www.codecademy.com/resources/docs/html/tags/head) tag. Any combination of the following three attributes could be used in the `<font>` tag, with at least one being required:

- `color`: Sets the [color](https://www.codecademy.com/resources/docs/css/colors) for the font/text using a named color, hexadecimal, or RGB.
- `face`: Sets the font for the text (e.g., `face="verdana"`).
- `size`: Sets the size of the font/text using absolute units ranging from 1-7 (e.g., `size="5"`).

## Example

```html
<html>
<head>
<basefont size="5" font="verdana" color="green" />
</head>
<body>
<p>
This text should be size 5 the font should be verdana and the color should
be green.
</p>
</body>
</html>
```

![Output of the basefont tag example](https://raw.githubusercontent.com/Codecademy/docs/main/media/basefont-tag-example.png)
2 changes: 1 addition & 1 deletion content/html/concepts/tags/terms/font/font.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ At least one of the following three attributes is required for the `<font>`. How

- `color`: What [color](https://www.codecademy.com/resources/docs/css/colors) the font/text should be. The color can be set to a named `color`, hexadecimal or RGB.
- `face`: What font the text should be. For example, to have the text be `verdana`, the `face` attribute would be set to `face="verdana"`.
- `size`: Sets the size of the font/text. It can use absolute units and relative units ranging from 1-7. Absolute units are used by `size="5"` or any other number 1-7. Relative units are relative the size of the `<basefont>` tag which is also deprecated. The attribute would look something like this `size="+5"`.
- `size`: Sets the size of the font/text. It can use absolute units and relative units ranging from 1-7. Absolute units are used by `size="5"` or any other number 1-7. Relative units are relative the size of the [`<basefont>`](https://www.codecademy.com/resources/docs/html/tags/basefont) tag which is also deprecated. The attribute would look something like this `size="+5"`.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Dusch4593 Made 1 slight change here


## Example

Expand Down
Binary file added media/basefont-tag-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.