Can I use Bootstrap 4 utilities to horizontally center an element like a <select>
within a col
at a specific breakpoint and below? I want to achieve this without using custom CSS.
For instance, I want to center a <select>
at xs and sm breakpoints, but have it left-aligned at md, lg, and xl breakpoints.
Bootstrap's mx-sm-auto
utility only centers the element at the sm breakpoint and above. Here's an example: https://codepen.io/cpj22/pen/QWLZwJd
(Note to editors: I have checked popular answers on SO, all related to horizontally centering inline elements. If there is a similar question, please ensure it refers to block elements as Bootstrap 4 has different utilities for each type)