The validator's HTML is invalid too. All I get is "Enable JavaScript and cookies to continue" but of course doing that doesn't actually work either. It's crazy that even the W3C has put itself behind cloudflare's walled garden. You'd think if anyone would respect the open web and standards it'd be them. At least HN's page is actually HTML even if it might not be fully standards compliant. That's far better than the W3C's showing here.
The CSS is also inconsistent, if not invalid. (I noticed this two weeks ago while creating a theme for a SSG.)<p>One rule is duplicated (a:visited) where it seems it should refer to a specific class (.hnmore a:visited):<p><pre><code> a:link { color:#000000; text-decoration:none; }
a:visited { color:#828282; text-decoration:none; }
...
.subtext a:link, .subtext a:visited { color:#828282; }
.subtext a:hover { text-decoration:underline; }
.comhead a:link, .subtext a:visited { color:#828282; }
.comhead a:hover { text-decoration:underline; }
.hnmore a:link, a:visited { color:#828282; }
.hnmore { text-decoration:underline; }
</code></pre>
Some lines don't have a trailing semicolon while the majority do. 0 probably doesn't need units. ".votelinks.nosee div.votearrow.rotate180" could just have one class rather than this nested thing.<p>The single-pixel gif as a spacer, that takes my mind back to Geocities.<p>Sums up software pretty well. If it works, move on to the next thing. No need to get lost in the details that a tiny handful of people see.
In defense, half of these look like what I'd call "normal" HTML, granted I'm not up on the latest fads.<p>But "<center>" is depreciated now? Come on.<p>"Width" and "height" attributes too? To what purpose? They are clear, easy to use, and apparently still widely supported with no issue.<p>And yet to see a browser that actually cares about DOCTYPE...usually its pretty obvious when the next line is <html><p>Edit: I seem to be mistaken about the importance of doctype for some situations.
I think a lot of those are bogus, but there are some real ones such as cases where there is no space between attributes, like<p><pre><code> <element this=“that”in=“out”/>
</code></pre>
there are a lot of old elements being used where css could be used instead, probably if the HTML was updated like that and they were smart about selectors it would get the page size down a bit. Then there is the <doctype> thing which may seem like a lot of bullshit, I don’t know how it now but years ago it did make a difference because if you didn’t have it browsers would go into a compatibility mode with old web pages.<p>Part of Netscape’s competitive advantage back in the day was that it handled broken HTML in an undocumented way and broken HTML is so common that a browser that doesn’t handle broken HTML the same way is a broken browser. One of the many great things in HTML is that it defines that behavior.<p>It would be a fun project to CSS-ize the HN front page with an aim to minimizing size.
No discussion on HTML validation/parsing is complete without mentioning this all time SO classic<p><a href="https://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags" rel="nofollow noreferrer">https://stackoverflow.com/questions/1732348/regex-match-open...</a>
Speaking of the HTML it would be great to have a way to increase the text size for mobile devices. The Hacker News layout doesn't look to great in reader view.
There was a time when I demanded of myself that all the sites that I built for clients had a perfect validation score. Well, I no longer build web sites.
isn't it only xhtml that needs to be strictly valid....<p>i mean the garbage that gets churned out by react and node generators these days is barely even html.