Module 16: Validation, Debugging, and Practical Projects
Obsolete HTML Elements and Attributes
Recognize outdated markup and replace presentational or obsolete patterns with modern HTML and CSS.
Older websites may contain elements and attributes that should not be used in new work. Examples include font, center, big, strike, marquee, and layout tables. Some old attributes also attempted to control presentation directly.
<!-- Old presentational markup -->
<center><font color="red">Sale ends today</font></center>
<!-- Modern structure; appearance belongs in CSS -->
<p class="notice">Sale ends today</p>
The modern version gives the content an appropriate structure and leaves presentation to CSS. If the message is genuinely urgent, use suitable semantics and accessible styling rather than relying only on a red color.
HTML is a living standard. Some features are added, refined, or removed from conformance guidance over time. Check the current element reference and browser compatibility information when using a less familiar feature.
The font and center elements are obsolete. The div element is not obsolete; it remains a valid generic container when no more specific element fits. Evaluate the actual element and its current status rather than judging by its age.