如何防止按钮在悬停时调整大小?我希望它们保持固定但宽度不同
.btn-group.simple-btn-group role="group"
button.btn.btn-default type="button" Some
button.btn.btn-default type="button" Something
.simple-btn-group
.btn:hover
font-weight: bold
最佳答案
.simple-btn-group
.btn:hover
font-weight: bold
粗体值会在一定程度上增加文本大小,从而导致按钮展开。删除属性 font-weight
如果您需要粗体文本,请使用下面的内容
为了在正常和悬停状态下都具有固定宽度,请设置按钮的宽度,使其高于两种状态下的按钮。
.simple-btn-group
.btn
width: 55px; // Make sure this is higher than hover state too
关于html - 如何固定按钮组中的按钮宽度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30346619/