<button type="button" class="btn btn-primary btn-lg">Click me</button>
The class btn-lg in Bootstrap makes the button large. Without it, buttons are medium sized by default.
The correct class for a small button in Bootstrap is btn-sm. Other classes like btn-xs or btn-mini are not valid in Bootstrap 5.
<button class="btn btn-primary btn-xs">Click</button>
<button class="btn btn-primary btn-xs">Click</button>
The class btn-xs is not defined in Bootstrap 5. The button will ignore it and render with default size.
The selector button.btn-lg selects all <button> elements with the class btn-lg. Other options select descendants or are invalid.
btn-lg. What should you add to improve accessibility for screen readers?<button class="btn btn-primary btn-lg">Submit</button>
Adding aria-label gives screen readers a clear description of what the button does. tabindex="-1" removes keyboard focus which harms accessibility. role="presentation" hides the button from assistive tech, which is wrong. Inline styles do not improve accessibility.
