News for hackers. Stuff that matters.
Re:Show HN: A simple, plain, minimal, classless CSS for simp... by SippinLean on Sunday December 06, 2020 @03:02PM (#25326187)
> If you want heading anchor links, go for something like[...]

...something like `a > h1`. Anchors wrapping block headings feels...wrong, but it's valid HTML5.

Most browsers will set the inner `h1` as display: block so the click/tap target for the `a` becomes larger. (`h1 > a` with `display: block` would have the same result though).

Also make sure that content isn't being duplicated for the user, `a` and `h1` are waypoints for users. `aria-` attributes can help you here.

Re:Show HN: A simple, plain, minimal, classless CSS for simp... by chrismorgan on Monday December 07, 2020 @01:52PM (#25335609)
`a > h1 > title text` has basically the same set of problems as `h1 > a > title text`. I’m saying that the anchor link should be separate from the title text, and largely hidden (from screen readers and keyboard navigators).