twitter bootstrap - How can I avoid using too many classes in CSS? -
i using bootstrap css framework. want create table has many styles. code this:
<table id="mytable" class="table table-bordered table-striped table-condensed"> .... </table> how can avoid using many classes (table table-bordered table-striped table-condensed) here? can css oo extend? mean define class named mytable , can have many predefined styles.
dummy code:
table.mytable{ have_class: table table-bordered table-striped table-condensed; }
i'm not quite sure mean. want use classes when have to, , target element first. if it's not possible .class element add class. remember, can target more putting space , adding class/id/element. more add, more specific becomes.
examples
table
#mytable tr
#mytable tr.first
#mytable .odd a
also, if problem pre-defined twitter bootstrap classes, problem using grid/styled boilerplate. it's not lightweight or lean stretch of imagination. twitter bootstrap getting things quickly, , prototyping... not completed websites.
if youre looking clean code, you'd want code scratch.
Comments
Post a Comment