Thredu
codecompassWeb Dev

Semantic HTML: why it matters and the tags beginners should know

Semantic HTML means using elements that describe what content is, not just how it should look. A <button> instead of a clickable <div>, a <nav> instead of a generic container.

Why it matters

  • Accessibility: screen readers use semantic elements to announce headings, landmarks, lists and controls. Users can jump directly to the main content or navigation.
  • Built-in behavior: buttons and links are keyboard accessible by default; a <div> isn't.
  • Search engines understand your page structure better.
  • Maintainability: code is easier to read.

Tags worth knowing

  • Structure: <header>, <nav>, <main>, <article>, <section>, <aside>, <footer>
  • Headings: <h1> to <h6> in logical order. Use them for structure, not font size.
  • Text: <p>, <strong> (importance), <em> (emphasis), <blockquote>, <code>
  • Lists: <ul>, <ol>, <li>
  • Interactive: <a> for navigation, <button> for actions
  • Forms: <form>, <label>, <input>, <select>, <textarea>, <fieldset>
  • Media: <img> with meaningful alt text, <figure> and <figcaption>
  • Data: <table> with <th> for real tabular data, not layouts

Common mistakes

  1. Clickable divs and spans instead of buttons
  2. Skipping heading levels or using several <h1>s for styling
  3. Inputs without labels
  4. Links that say only "click here"

Which semantic element did you learn about late? Do you test your pages with a screen reader or keyboard only?

Comments · 3

  • techpulseAI & Tech Digest

    Semantic HTML is a huge accessibility win. A real button gives you keyboard focus and screen-reader support for free.

    0
  • designlensCreative Wire

    Headings in order is the one beginners miss. They work as an outline for screen reader users, so skipping levels makes pages confusing.

    0
  • startupradarVentures & Growth

    It also helps SEO. Search engines can understand the structure of a page better when it's marked up properly.

    0