Skip to content

[Edit] HTML: <blink> #7486

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
117 changes: 109 additions & 8 deletions content/html/concepts/elements/terms/blink/blink.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,126 @@
Title: '<blink>'
Description: 'Used to make text flash on and off and is now obsolete, deprecated, and non-standard.'
Subjects:
- 'Web Development'
- 'Web Design'
- 'Web Development'
Tags:
- 'Elements'
- 'Tags'
- 'Style'
- 'Obsolete'
- 'Style'
- 'Tags'
CatalogContent:
- 'learn-html'
- 'paths/front-end-engineer-career-path'
---

The `<blink>` element is an obsolete tag that was historically used to make text flash on and off. However, it is now considered to be obsolete and non-standard.
The HTML **`<blink>`** element is an obsolete [tag](https://www.codecademy.com/resources/docs/html/tags) that was historically used to make text flash on and off. However, it is now considered to be obsolete and non-standard.

> **Note:** This is now deprecated from most browsers and is not part of the current [HTML specifications](https://html.spec.whatwg.org/). Using this tag is a bad design practice and is heavily discouraged by [accessibility standards](https://www.w3.org/WAI/standards-guidelines/wcag/). The [CSS specification](https://www.w3.org/TR/css-2021/) allows browsers to ignore this tag.

## HtML `<blink>` Syntax

```pseudo
<blink>Blinking Text</blink>
```

## Example 1: Basic Usage of HTML `<blink>`

This example demonstrates the basic usage of the HTML `<blink>` element:

```html
<blink>Blinking Text</blink>
```

This used to make the specified text blink in old browsers. However, it has no effect in modern browsers today.

## Example 2: Using CSS instead of HTML `<blink>`

This example uses [CSS](https://www.codecademy.com/resources/docs/css) instead of HTML `<blink>` to create a blinking effect:

> **Note**: This is now deprecated from most browsers, and is not part of the current [HTML specifications](https://html.spec.whatwg.org/). Using this tag is a bad design practice and is heavily discouraged by [accessibility standards](https://www.w3.org/WAI/standards-guidelines/wcag/). The [CSS specification](https://www.w3.org/TR/css-2021/) allows browsers to ignore this tag.
```html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Blink</title>
<style>
@keyframes blink {
0%,
49% {
opacity: 1;
}
50%,
100% {
opacity: 0;
}
}

.blink {
animation: blink 1s steps(1, start) infinite;
}

@media (prefers-reduced-motion: reduce) {
.blink {
animation: none;
}
}
</style>
</head>
<body>
<p class="blink">This text blinks using CSS animation</p>
</body>
</html>
```

Here is the output:

## Syntax
![Blinking text using CSS instead of HTML <blink>](https://raw.githubusercontent.com/Codecademy/docs/main/media/html-blink-1.gif)

## Example 3: Using CSS + JS instead of HTML `<blink>`

This example uses CSS and [JS](https://www.codecademy.com/resources/docs/javascript) instead of HTML `<blink>` to create a blinking effect:

```html
<!-- Not advised to use this tag! -->
<blink><!-- Blinking text goes here --></blink>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>JS blink</title>
<style>
.hidden {
visibility: hidden;
}
</style>
</head>
<body>
<p id="alertText">This text will blink via JS</p>

<script>
const el = document.getElementById('alertText');

let blinking = true;
let interval = setInterval(() => {
el.classList.toggle('hidden');
}, 700);
</script>
</body>
</html>
```

Here is the output:

![Blinking text using CSS and JS instead of HTML <blink>](https://raw.githubusercontent.com/Codecademy/docs/main/media/html-blink-2.gif)

## Frequently Asked Questions

### 1. Does HTML `<blink>` still work?

No. The HTML `<blink>` tag is obsolete and no longer works in modern browsers like Chrome, Firefox, or Edge. It was only supported in some older browsers and now it's ignored by HTML parsers.

### 2. Why was HTML `<blink>` removed?

HTML `<blink>` was removed because it caused accessibility problems, distracted readers, and offered no real semantic or functional benefit. The World Wide Web Consortium (W3C) deprecated it in HTML 4.01 and excluded it from HTML5 standards.

### 3. Can I re-enable HTML `<blink>` in modern browsers?

Not directly. Modern browsers have completely removed native support for HTML `<blink>`. You can only replicate its behavior using CSS or JS animations, which gives you more control and better accessibility compliance.
Binary file added media/html-blink-1.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/html-blink-2.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.