Deprecated HTML Elements
Deprecated elements were removed from the HTML specification because CSS provides better alternatives. While browsers still render most deprecated elements for backwards compatibility, they signal outdated code and may be removed from future browser versions.
Why It Matters
Using deprecated elements makes your code harder to maintain, may cause inconsistent rendering across browsers, and signals to search engines that your site uses outdated practices.
Code Examples
<center>Centered content</center> <font size="5" color="red">Big red text</font> <marquee>Scrolling text</marquee>
<div style="text-align: center">Centered content</div> <span style="font-size: 1.5rem; color: red">Big red text</span> <div class="scroll-animation">Animated text</div>
How to Fix
- 1<center> → Use CSS text-align: center or flexbox/grid centering.
- 2<font> → Use CSS font-size, color, and font-family properties.
- 3<marquee> → Use CSS animations or JavaScript for scroll effects.
- 4<big> / <small> → Use CSS font-size (note: <small> is still valid for fine print).
- 5<strike> / <s> → Use CSS text-decoration: line-through, or <del> for deleted content.
Check Your HTML Now
Our validator detects this error automatically and shows the exact line number.
Open HTML ValidatorHostinger — Fast & Affordable Web Hosting
Deploy clean, validated HTML on reliable hosting.
Related HTML Errors
Missing DOCTYPE Declaration
Learn why <!DOCTYPE html> is required and what happens when it's missing. Fix quirks mode rendering issues.
Excessive Inline Styles
Why inline style attributes make HTML harder to maintain. Learn when to use external CSS instead of inline styles.
Unclosed HTML Tag
Learn why unclosed HTML tags break layouts and how to fix them. Find unclosed div, p, span, and other tags with examples.