Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Why use .btn and .btn-primary rather than button and button.primary? Reply To: Why use .btn and .btn-primary rather than button and button.primary?

#238802
Senff
Participant

The only reasons I can come up with are, for instance, to allow developers to use .btn classes on links

That’s pretty much the main reason; in some cases, other tags are supposed to look like buttons and then you can easily style them by applying the class “btn”. Not just for A HREF links, but definitely also for INPUTs of type “button”.

By having a generic class “btn” (instead of just having them on BUTTONS) keeps your options open.