col-auto class do when applied to a column inside a .row?The col-auto class in Bootstrap sizes the column width automatically based on the content inside it. It does not stretch to fill the remaining space like col or col-* classes.
Option D uses the correct Bootstrap classes: col-auto for auto-sized column and col for flexible column filling remaining space.
<div class="row"> <div class="col-auto bg-primary text-white p-2">Short</div> <div class="col bg-secondary text-white p-2">This column fills the rest of the row</div> </div>
<div class="row"> <div class="col-auto bg-primary text-white p-2">Short</div> <div class="col bg-secondary text-white p-2">This column fills the rest of the row</div> </div>
col-auto sizes to content and col fills remaining space.The col-auto column sizes itself just enough for the 'Short' text with blue background. The col column fills the rest of the row with gray background.
col-auto class inside a .row?col-auto inside .row.The selector .row > .col-auto selects all elements with class col-auto that are direct children of elements with class row.
col-auto columns containing buttons. What is the best way to improve keyboard navigation and screen reader accessibility for these auto-sized columns?Adding role="group" and an aria-label to the container groups the buttons semantically, improving screen reader context and keyboard navigation.
