Videos
W3C Markup Validation Service: This is a well-known and widely used tool for validating HTML markup. It's available as a web service, and you can also download the source code and host it on your local environment. It can validate individual pages or entire websites by submitting a sitemap or list of URLs.
Visit https://validator.w3.org/
These days you likely want something like html-validator for a specific programming language, in this case Javascript, configured to scan output HTML/CSS files and hooked into CI for automated validation.
Unless of course there's some user input that can result in different HTML which would normally not be checked. In that case you can generate special test output just for tests and cover all the cases that need to be covered. Might not work for your website depending on what it is and what exactly you need to verify, but I'm mentioning it as the most optimal possibility for lots of more basic sites.
My old standby, the W3C Validator, appears to be a bit out-of-date and doesn't support nested selectors.
I tried the csstree validator but it stops working when input contains CSS variables (e.g. --color: green).
I also tried the csstree-validator NPM package but it's choking on nested @media rules, which are a fairly recent addition.
What I'm really hoping for is an NPM package that can validate the CSS compiled by a static site generator, but even just something I could copy-paste into would be fine.
Any recommendations?
Edit: Actually, Stylelint seems like it'll do just fine, with the added advantage that we already use it in our projects for linting!