x
1
2
3
4
5
<div class="group" role="group" aria-label="Basic example">
<a class="btn" href="#">Profile</a>
<a class="btn" href="#">Settings</a>
<a class="btn" href="#">Message</a>
</div>
1
2
3
4
5
<div class="group" role="group" aria-label="Basic example">
<%= link_to "Profile", "#", class: "btn" %>
<%= link_to "Settings", "#", class: "btn" %>
<%= link_to "Message", "#", class: "btn" %>
</div>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
.group {
align-items: center;
display: flex;
:first-child {
border-end-end-radius: 0;
border-start-end-radius: 0;
}
:last-child {
border-end-start-radius: 0;
border-start-start-radius: 0;
}
:not(:first-child, :last-child) {
border-radius: 0;
margin-inline: -1px;
}
> :focus-visible {
z-index: 1;
}
}
Java Script is not required or multiple files are needed, check the notes.