1. Missing required closing tags
Leaving an inline element open can apply its formatting to text that follows. Close it where the intended content ends:
<!-- Wrong -->
<p><strong>Important text</p>
<p>Ordinary text</p>
<!-- Right -->
<p><strong>Important text</strong></p>
<p>Ordinary text</p>Some closing tags are optional in specific positions. For example, a paragraph can end before the next paragraph starts without an explicit </p>. Writing the closing tag can still make the source easier to follow.
2. Incorrect nesting
Close nested elements in reverse order. Browsers repair crossed tags, so the resulting document structure may differ from what the source suggests.
<!-- Wrong -->
<strong><em>Bold and italic</strong></em>
<!-- Right -->
<strong><em>Bold and italic</em></strong>3. Missing alternative text
Describe an informative image with alt text. For a decorative image, use alt="" so screen readers can skip it. The file in this example is a placeholder; replace cat.jpg with an image URL you can load.
<!-- Wrong -->
<img src="cat.jpg">
<!-- Right -->
<img src="cat.jpg" alt="Orange cat sleeping">4. Obsolete presentation tags
Replace <center> and <font> with CSS. The <b> element is still part of HTML: it draws attention without adding importance. Use <strong> for importance and CSS when you only want a heavier font.
<!-- Deprecated -->
<center><font color="red">Warning</font></center>
<!-- Modern -->
<p style="text-align:center; color:red;">
Warning
</p>5. Missing the doctype
Put <!DOCTYPE html> at the start of a complete document to select standards mode. Omitting it can trigger quirks mode and change layout behaviour.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>My Page</title>
</head>
<body>
...
</body>
</html>6. Repeating inline styles
Inline styles apply to one element. If the same styles appear throughout a page, a CSS class makes them easier to update together. Email templates have different compatibility requirements; see the email preview guide.
Check the source as well as the preview
Open an example in the viewer to inspect its appearance. Use the W3C HTML Checker to check markup validity. A live preview and syntax highlighting do not replace validation: browsers can render invalid HTML without a visible error.