TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

HN's HTML Is Invalid

43 pointsby dickficklingalmost 2 years ago

18 comments

superkuhalmost 2 years ago
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.
评论 #37176001 未加载
PennRoboticsalmost 2 years ago
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&#x27;t have a trailing semicolon while the majority do. 0 probably doesn&#x27;t need units. &quot;.votelinks.nosee div.votearrow.rotate180&quot; 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.
peteealmost 2 years ago
In defense, half of these look like what I&#x27;d call &quot;normal&quot; HTML, granted I&#x27;m not up on the latest fads.<p>But &quot;&lt;center&gt;&quot; is depreciated now? Come on.<p>&quot;Width&quot; and &quot;height&quot; 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 &lt;html&gt;<p>Edit: I seem to be mistaken about the importance of doctype for some situations.
评论 #37176136 未加载
评论 #37176704 未加载
评论 #37176460 未加载
sodapopcanalmost 2 years ago
Ah, cellpadding and cellspacing. A blast from the past!
评论 #37175950 未加载
PaulHoulealmost 2 years ago
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> &lt;element this=“that”in=“out”&#x2F;&gt; </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 &lt;doctype&gt; 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.
评论 #37176353 未加载
Wronnayalmost 2 years ago
Which shows that you don&#x27;t need valid HTML to be successful
评论 #37176402 未加载
paxysalmost 2 years ago
There&#x27;s a distinction (that the validator doesn&#x27;t make) between &quot;invalid&quot; and simply being an older version.
评论 #37176312 未加载
dickficklingalmost 2 years ago
(if it wasn&#x27;t clear, this is submitted in jest)
评论 #37176016 未加载
vishnuguptaalmost 2 years ago
No discussion on HTML validation&#x2F;parsing is complete without mentioning this all time SO classic<p><a href="https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;1732348&#x2F;regex-match-open-tags-except-xhtml-self-contained-tags" rel="nofollow noreferrer">https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;1732348&#x2F;regex-match-open...</a>
trinsic2almost 2 years ago
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&#x27;t look to great in reader view.
评论 #37176428 未加载
评论 #37176038 未加载
intrasightalmost 2 years ago
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.
steviedotbostonalmost 2 years ago
The overwhelming majority of HTML on the web is invalid. Achieving 100% valid HTML nowadays is a fools errand, save for extremely simple web pages.
评论 #37176157 未加载
mouzogualmost 2 years ago
isn&#x27;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.
评论 #37179510 未加载
water9almost 2 years ago
DANG what a blunder
评论 #37176068 未加载
johneaalmost 2 years ago
Plain Text Rules!<p>If you need tables, render in a fixed width font.<p>HTML in email sucks in many more ways than are described here...
评论 #37187316 未加载
TruffleLabsalmost 2 years ago
But HN still works good enough:)
Juliatealmost 2 years ago
So what?
geriksonalmost 2 years ago
Oh no, someone call the Internet police.