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.

A CSS Snippet That Makes Any HTML Page Look Good

5 pointsby lowmemcpualmost 5 years ago

2 comments

1f60calmost 5 years ago
Very nice. For those of us who&#x27;d appreciate a live demo (like me), I wrote this script:<p><pre><code> document.querySelectorAll(&#x27;link[rel=&quot;stylesheet&quot;], style&#x27;).forEach((style) =&gt; style.remove()); const style = document.createElement(&quot;style&quot;); style.appendChild(document.createTextNode(&quot;body{font-family:sans-serif;line-height:140%;max-width:38rem;padding:2rem;margin:auto}h1,h2,h3,h4,h5{margin-bottom:.6rem;line-height:120%}p{margin:0 0 1rem}&quot;)); document.head.appendChild(style);</code></pre>
评论 #23879830 未加载
Geffreyalmost 5 years ago
Hi! Geffrey from … geffrey.io here. Thanks for posting!<p>That website is a bit wonky, sorry for that.<p>Thanks again!