我使用的是 Google Chrome,我会在此按钮中设置自动 min-height
样式:
<button style="padding: 0; min-height: auto"
type="button"
class="btn btn-primary btn-block">
</button>
为什么自动不起作用? 0 或 100% 对
最佳答案
根据我的理解,你不能设置 min-height: auto
它必须是一些整数,比如 10px 或其他东西
来自这个 answer
CSS2.1 defines the initial value of min-height to be 0 ,不是自动的。 auto这个值在CSS2.1中是不存在的,所以在CSS2.1中是无效的。只需使用 min-height: 0 代替:
您可以使用 px、cm 等或 % 或 inherit 指定最小高度
关于html - 不工作最小高度样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40259523/