twitter bootstrap - Integrate css framework work only in specified class or id -
my problem project integration website. example have website build 0 , specified system build on boostrap or foundation. when try integrate on website, website start using boostrap or foundation style. posible make work css in example
<div id="boostrap_only"> <table class="table table-bordered">...</table> <!-- here works --> </div> <table class="table table-bordered">...</table> <!-- here don't work -->
there many ways .
1- using less ( in less file include bootstrap )
.bootstrap { @import "/path-to-bootstrap-less.less" @import "/path-to-bootstrap-responsive-less.less" }
2- detailed solution :
the final fix use sass (recommended off-site), allows nest elements , automatically produce final css. step step process is:
- concatenate 2 bootstrap files (
bootstrap.css
,bootstrap-responsive.css
)bootstrap-all.css
. - create new sass file,
bootstrap-all.scss
, contentdiv.bootstrap {
. - append
bootstrap-all.css
bootstrap-all.scss
. - close
div.bootstrap
selector appending}
bootstrap-all.scss
. - run sass on
bootstrap-all.scss
produce final css file. - run yui compressor on final file produce minimised version.
- add minimised version head element , wrap want styles apply in
<div class="bootstrap"></div>
.
for reference see links link 1
Comments
Post a Comment