html - 用新类覆盖 'btn-xs' 的 Bootstrap CSS

标签 html css twitter-bootstrap odoo-8

您好,我是 Bootstrap 的新手,想用新的高度宽度和填充覆盖“btn-xs”。本质上使按钮比实际更小,文本也会缩小。

我尝试在下面的代码行中添加一个新类“custom”,但它没有生效。

<button class="btn btn-default btn-xs custom" style=""> Filter</button>

下面是我的自定义 CSS:

custom {
font-size: 10px;
padding: 1px 10px}

我可能正在做一些极其愚蠢的事情。感谢您的帮助。

最佳答案

为避免使用 !important,您可以尝试更加具体。

该按钮可能受 bootstrap CSS 中设置的规则影响:

.btn-group-xs>.btn, .btn-xs { ... }

尝试:

.btn-group-xs>.btn.custom, .btn-xs.custom {
font-size: 10px;
padding: 1px 10px}

关于html - 用新类覆盖 'btn-xs' 的 Bootstrap CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37015194/

相关文章:

javascript - 可点击表格单元格内的按钮

css - 当我们使用 modernizr 动态加载我们的资源时,无样式的内容一闪而过

javascript - 如何防止 Meteor.js 模板在没有数据的情况下呈现

javascript - bootstrap 按钮无法与 jquery 插件一起使用

javascript - 使用 onload 为 Internet Explorer 创建 CSS 回退

html - 图像显示在边缘

javascript - 如何在不同时间增加多个元素的 css top 值?

html - 一个固定宽度的 div 和两个可变的

php - 我希望页面在到达页面底部时自动包含更多帖子

javascript - 如何在 javascript 中正确显示和隐藏图像?