Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Semantic sections without the need for class names using aria-labelledby. Has the bonus of being able to link to each section with an anchor.
<!-- Suck on this BEM! -->
<section aria-labelledby="latest-products">
<h2 id="latest-products">Latest Products</h2>
<ul>
...
</ul>
</section>
<section aria-labelledby="press-news">
<h2 id="press-news">Latest Products</h2>
<ul>
...
</ul>
</section>
section[aria-labelledby="latest-products"] {
/* Latest products styling */
}
section[aria-labelledby="press-news"] {
/* Press news styling */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment