【问题标题】:CSS on bootstrap tables not working引导表上的 CSS 不起作用
【发布时间】:2017-02-02 19:24:45
【问题描述】:

我在我的表中使用以下 css:

.lh1 {
    line-height: 50px;
    }

我的桌子是这样的:

<table class="table table-bordered lh lh1">
..
..
..
</table>

但无论我为行高使用哪个值,我的表格都不会改变。此表中的其他 .css 工作正常。

这个问题的原因可能是什么?

【问题讨论】:

  • 到底是什么问题?

标签: html css twitter-bootstrap html-table


【解决方案1】:

你需要这样做。

CSS

.lh1 > tbody > tr > td {
    line-height: 50px;
    }

您的 CSS 不会覆盖引导 CSS。这是demo

【讨论】:

  • 效果很好。谢谢!
【解决方案2】:

尝试:

.lh1 {
   line-height: 50px !important;
}

您的引导程序可能会覆盖此

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-29
    • 2014-09-19
    • 2015-07-05
    • 1970-01-01
    • 2014-12-21
    相关资源
    最近更新 更多