Before you invest in semantic HTML
It comes up on almost every project, usually later than it should. Before you spend anything on semantic HTML, it is worth confirming a few things are already true.
The question is rarely whether something can be built, but what it costs to keep running afterwards. Budget a little time for it every quarter and it never becomes a project of its own.
Prerequisites
- You can describe the outcome you want in one sentence
- Someone owns it after the work is done
- The right element gives you behaviour and accessibility for free
- You have a way to tell whether it worked
Where it usually goes wrong
A div with a click handler is not a button. Getting it slightly wrong is survivable. Ignoring it entirely is not. Assume whoever inherits this will have half your context and none of your patience.
Semantic markup is the cheapest accessibility work available. Small and consistent beats large and occasional here. Check it against what you would want a competitor's site to get wrong.
What this looks like day to day
Most development decisions are really maintenance decisions wearing a different hat. Three things worth confirming about semantic HTML before you move on:
- Someone can say what the current setup is without going to look
- The right element gives you behaviour and accessibility for free — and you know whether that is true here
- There is a way to tell whether the last change to this helped
If you want a second opinion on how yours is set up, ask.