4 ms·
Stop using so many divs An intro to semantic HTML
- octosphere 8y agoTo save some bytes i like to use <i>. It makes any text italic, but that can be fixed with some styling.
- two2two 8y agoThe html <em> tag is the current best practice for this from my understanding. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/em https://developer.mozilla.org/en-US/docs/Web/HTML/Element/em
- CM30 8y agoNice article, especially how it explains just how you can use said semantic elements for more readable source code. And yeah, there's no reason not to use semantic HTML now, or to create sites/apps infected with divitis. Things like article, aside, footer, header, nav, section, etc have been supported in almost all browsers for years now, and main has pretty much unanimous support too. Unless you're designing for IE 8 (in which case your app probably won't work anyway), there's no reason to use so many divs.