---
name: techboidesign-techboi-web-validation
title: techboi web validation
kind: skill
version: 1.0
description: >
  Alejandro Alvarez's pre-hand-in checklist for static websites — automatic
  check.sh (HTML validation, fragile selectors, desktop-first queries, missing
  alt, inline JS), W3C validators and manual browser checks. Use before shipping
  or handing in an HTML/CSS site, or when asked to validate or check a page.
updated: 2026-12-03
authored_by: Techboidesign
author_url: https://github.com/Techboidesign
source_url: https://github.com/Techboidesign/skill-pack/tree/HEAD/skills/techboi-web-validation
brought_by: kt
license: MIT
---

# Techboi Web Validation

Run these before every hand-in. A page is not finished until all of them pass. The rules they enforce are in the `techboi-web-rules` skill.

---

## 1. Automatic: `check.sh`

From any folder:

```sh
sh scripts/check.sh path/to/project
```

It runs six checks and lists every line that fails. Exit code `0` means all six passed.

| # | Check | What fails it |
|---|---|---|
| 1 | **HTML validation** with `html-validate` (W3C HTML rules: nesting, duplicate ids, missing attributes, headings) | any error |
| 2 | **Fragile selectors** in the CSS | `:first-child`, `:last-child`, `:nth-child`, `:nth-of-type`, element chains like `body > header > a`, id selectors like `#plans article` |
| 3 | **Desktop-first queries** | any `@media (max-width: …)` |
| 4 | **Images without `alt`** | an `<img>` with no `alt` attribute |
| 5 | **Inline JavaScript** | `onclick=` and other `on…=` attributes, `javascript:` links, `<script>` without `src`. External `defer` files in `scripts/` are fine |
| 6 | **Motion** (rules in `techboi-motion`) | `transition: all`, `ease-in`, a duration typed by hand instead of a token, any `--dur*` token over 300ms |

**Exceptions.** A structural selector that only sets the rhythm inside one component (for example "the last item in an open accordion gets bottom padding") is allowed. Mark it with `allowed:` in its comment and the checker skips it:

```css
.accordion > :last-child { /* allowed: list rhythm inside a component */
```

The first time it runs, `npx` downloads `html-validate`, so you need a connection.

---

## 2. Official W3C validator

`check.sh` uses the same HTML rules, but reviewers usually check with the official tool. Run it too:

- **HTML:** https://validator.w3.org/nu/ → *Check by file upload*, one page at a time. Or *Check by address* once the site is on Netlify.
- **CSS:** https://jigsaw.w3.org/css-validator/ → upload `styles.css`. New features like `:has()`, `@container` or `animation-timeline` may show as warnings. That is the validator being behind, not an error.

The goal is **0 errors and 0 warnings** on every page. Common warnings, and the fix:

| Warning | Fix |
|---|---|
| Card title inside `<figcaption>` | Use an `<h3>` for the title. `figcaption` is only for a caption of the image. |
| Duplicate ID | Every `id` is unique on the page. Watch form fields named like sections (`id="about"`). |
| Section lacks heading | Every `<section>` starts with an `h2` (or `h1`). If it has none, it is a `div`. |
| Empty heading / bad nesting | No `<div>` inside `<p>`, no block elements inside `<a>` you didn't mean, no skipped heading levels. |

---

## 3. Manual checks in the browser

Use DevTools device mode.

- [ ] **Widths:** 375, 768 and 1440 px, **and drag the window slowly through every width in between** (320 up to 1600). There is **no horizontal scroll** at any of them. To find what sticks out, run `[...document.querySelectorAll('*')].filter(e => e.getBoundingClientRect().right > innerWidth)` in the console.
- [ ] **Breakpoints:** check just below and just above each one (767 / 768 and 1023 / 1024). Nothing jumps, wraps badly or overlaps.
- [ ] **Safari:** open the site in Safari as well as Chrome. Grids, `aspect-ratio` and `text-decoration` differ.
- [ ] **WAVE** (wave.webaim.org, or its browser extension): run it on every page and fix every **error** (red). Contrast errors on a header that uses `mix-blend-mode` are a known false positive: check that one by eye (see `techboi-web-rules`, §12 Accessibility).
- [ ] **Keyboard:** Tab through the whole page. You reach every link, button and field, in a sensible order, and the focus ring is always visible. In a radio group, Tab enters it and the arrow keys change the choice.
- [ ] **Selectors:** every choice (product options, switch, gallery) works by clicking and by keyboard, with JavaScript turned off.
- [ ] **Without JavaScript** (DevTools → ⌘⇧P → *Disable JavaScript*): every page still works and reads. Scripts only make things smoother.
- [ ] **Hovers:** everything clickable reacts to the mouse. On a phone, nothing stays stuck in its hover state after a tap.
- [ ] **Form:** press Send with the form empty. Each required field shows its error state (`:user-invalid`) and its hint text.
- [ ] **Contrast:** text over images and video stays readable on the brightest frame. Lighthouse → Accessibility should report no contrast failures.
- [ ] **Zoom:** at 200% the page still reads and nothing is cut off.
- [ ] **Motion speed:** DevTools → Animations panel. Nothing UI-related runs longer than 300ms, exits are faster than entrances, nothing moves diagonally (see `techboi-motion`).
- [ ] **Reduced motion:** turn on *Reduce motion* (macOS: Settings → Accessibility → Display; or DevTools → Rendering → *Emulate prefers-reduced-motion*). Nothing grows or moves, video becomes a still image, and only colour changes remain.
- [ ] **Final detail:** the one chosen detail (accordion, scroll reveal, page transition or menu entrance) runs smoothly, and is off with reduced motion. Page transitions only run on a server (Netlify or a local server), not on a file opened from disk.
- [ ] **Lighthouse** (Chrome DevTools → Lighthouse, mobile): Accessibility and Best Practices at 100, Performance above 90.
