From the course: Bootstrap 3 Essential Training

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Using button groups

Using button groups - Bootstrap Tutorial

From the course: Bootstrap 3 Essential Training

Start my 1-month free trial

Using button groups

- Another great component is called button groups. You can use it to create different kinds of button combinations. So I'm starting out with a series of buttons right here. And in order to place them into groups I can add a div with a class of btn-groups. Let's go ahead and do that, we'll go ahead and put a div in here with a class of btn-group and we'll just take all these buttons and paste them in here. Let's go ahead and save. You can see that these become a group of unified buttons. Let's go ahead and do that to the other one as well. For screen readers and usability you need to add the role="group" to these. So let's go ahead and do that to both of these. Assigning a role to an element lets screen readers know about the expected functionality of that element. So it knows how to handle it properly. Now you should also add a label so that readers know what to say. For this type of element, you can add a ... as the label and use either an aria label or an aria labeled by attribute…

Contents