flâneur

endc/frontend-guidelines: Some HTML, CSS and JS best practices. ·

github.com · 2,277 words · saved by 1 readers

Some HTML, CSS and JS best practices.

HTML Semantics HTML5 provides us with lots of semantic elements aimed to describe precisely the content. Make sure you benefit from its rich vocabulary. <!-- bad --> <div id=main> <div class=article> <div class=header> <h1>Blog post</h1> <p>Published: <span>21st Feb, 2015</span></p> </div> <p>…</p> </div> </div> <!-- good --> <main> <article> <header> <h1>Blog post</h1> <p>Published: <time datetime=2015-02-21>21st Feb, 2015</time></p> </header> <p>…</p> </article> </main> Make sure you understand the semantics of the elements you're using. It's worse to use a semantic element in a wrong…

saved by

related reading