Equal width buttons to the widest one
Make a set of buttons equal in width to the widest one using a few lines of code.
- No JavaScript
- Works with any number of button
- Easily switch between the horizontal and vertical configuration
.container {
display: inline grid;
grid-auto-flow: column; /* OR row */
grid-auto-columns: 1fr;
}
See the Pen Equal width buttons by Temani Afif (@t_afif) on CodePen.