YOU MIGHT ALSO LIKE
ASSOCIATED TAGS
accessibility  common  developers  document  elements  explicit  heading  landmarks  mistakes  regions  rendering  screen  search  section  semantic  
LATEST POSTS

Where's the worst spot for a tattoo?

Where's the worst spot for a tattoo?

HTML

<!-- SECTION 1: COMMON MISTAKES -->

<section>

Common mistakes in HTML structure

Even experienced developers occasionally fall into bad habits that compromise code readability, SEO performance, and accessibility. Clean HTML is the foundation of a robust web page, yet several frequent missteps continue to slip into production codebases.

1. Neglecting semantic elements

One of the most widespread errors is over-relying on generic <code>&lt;div&gt;</code> and <code>&lt;span&gt;</code> tags for every layout requirement. Modern HTML provides a rich vocabulary of semantic elements such as <code>&lt;header&gt;</code>, <code>&lt;nav&gt;</code>, <code>&lt;main&gt;</code>, <code>&lt;article&gt;</code>, and <code>&lt;footer&gt;</code>. When developers ignore these tags, screen readers struggle to parse the page structure, and search engine crawlers lose vital context regarding which content is primary versus supplementary.

2. Skipping heading levels and breaking hierarchy

Heading tags (<code>&lt;h1&gt;</code> through <code>&lt;h6&gt;</code>) establish the document's logical outline. A common mistake is choosing heading tags based purely on default font size rather than hierarchical importance—for instance, jumping straight from an <code>&lt;h1&gt;</code> to an <code>&lt;h4&gt;</code> just to achieve a specific visual scale. Browsers and accessibility tools rely on sequential headings to build a proper document tree. Always maintain a descending order and never skip levels.

3. Improper tag nesting and unclosed elements

Browsers are remarkably forgiving when it comes to rendering malformed HTML, which often lulls developers into a false sense of security. However, unclosed tags or crossing inline and block elements (like placing a <code>&lt;div&gt;</code> inside a <code>&lt;p&gt;</code>) can lead to unpredictable rendering bugs across different rendering engines. Validating your markup regularly ensures your DOM tree matches your intended design.

</section>

<!-- SECTION 2: THE MISSED DETAIL -->

<section>

The detail people often miss: Document landmarks and ARIA roles

While developers routinely remember to include basic tags like <code>&lt;body&gt;</code> and <code>&lt;head&gt;</code>, one critical aspect frequently overlooked is how assistive technologies map the document using implicit and explicit landmark regions. Understanding this nuance elevates a website from merely functional to genuinely inclusive.

Leveraging explicit landmarks and ARIA roles

Many creators assume that simply using semantic tags like <code>&lt;nav&gt;</code> or <code>&lt;aside&gt;</code> is enough. However, complex applications often feature multiple navigation regions or search bars. Without explicit ARIA attributes—such as <code>role="search"</code> or unique <code>aria-label</code> attributes, screen reader users encounter multiple ambiguous "Navigation" landmarks with no way to distinguish between them. By defining clear, descriptive labels and mapping secondary regions correctly, you empower users to jump directly to the exact section they need without cognitive overload.

</section>