Creating Buttons with Modular, Reusable CSS Classes, and CSS3

Having CSS that is modular and reusable makes it organized and concise, thereby avoiding situations where you may feel like pulling your hair out. Wouldn't it be awesome to just add the class of .button to an anchor element, no matter where that anchor element is in your markup, and have it transform into a button? CSS is "reusable" if you're able to use its classes anywhere and don't need these classes to be qualified by parent elements as long descendant selectors. The term "modular" refers to the ability to add variations to the button by adding another class to it so that one element can have two classes that could come together to form something very different.

A good example ...

Get Mastering CSS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.