【发布时间】:2012-06-05 10:40:51
【问题描述】:
我正在使用引导 css 框架。我想创建一个有多种样式的表格。代码是这样的:
<table id="myTable" class="table table-bordered table-striped table-condensed">
....
</table>
如何避免在这里使用这么多的类(table table-bordered table-striped table-condensed)? CSS 可以做一些类似 OO 的扩展吗?我的意思是定义一个名为 myTable 的类,它可以有许多预定义的样式。
虚拟代码:
table.myTable{
have_class: table table-bordered table-striped table-condensed;
}
【问题讨论】:
-
考虑 LESS lesscss.org(需要 javascript)。看看
Mixins,我想这就是你要找的 -
@kaveman:Twitter Bootstrap 已经在使用 LESS。
标签: css twitter-bootstrap