I have a button group containing 10 buttons. At certain screen widths (responsive), I hide some of these media buttons.
The problem is that if I hide the last button, the new last edges of the buttons will not be rounded.
This is a tricky issue to describe, but very easy to show in Fiddle .
My question is: how to add rounded corners to the last visible button in a button group, and not just the last button, as it is now.
The code from the script below, according to the SO rules:
<div class="btn-group" id="sortBtns" role="group"> <button type="button" class="btn btn-default">First</button> <button type="button" class="btn btn-default">Second</button> <button type="button" class="btn btn-default">Third</button> <button type="button" class="btn btn-default">Fourth</button> <button type="button" class="btn btn-default">Fifth</button> <button type="button" class="btn btn-default">Sixth</button> </div> <div class="btn-group" id="sortBtns" role="group"> <button type="button" class="btn btn-default">First</button> <button type="button" class="btn btn-default">Second</button> <button type="button" class="btn btn-default">Third</button> <button type="button" class="btn btn-default">Fourth</button> <button type="button" class="btn btn-default">Fifth</button> <button type="button" class="btn btn-default" style="display:none;">Sixth</button> </div>
Note the absence of rounded corners on the βfifthβ in the second group of buttons.
I can do this using JavaScript by adding a new class to the last visible element, but I would prefer. Is there a cleaner solution just for CSS?
css twitter-bootstrap
Mike
source share