Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using bootstrap only in a special div

I use bootstrap in my TYPO3 frontend plugin, but I only want to use it in a special div, so that the class without_bootstrap won't be touched from the bootstrap classes.

For example

<div class="without_bootstrap">
     <div class="with_bootstrap">
     </div>
</div>

Is that possible?

like image 623
Felix Avatar asked Feb 26 '15 13:02

Felix


People also ask

How do I get Bootstrap to only one div?

use custom class name for div in which u dont want to use bootstrap.... As bootstrap apply js and css to only standard pre-defined names....and most important dont forget to use external . css and . js file to override styles and scripts for global tags which are defined in bootstrap plugin such as h,a etc....

Can you use Bootstrap with regular CSS?

Yes. You will want to put your additions in a separate file and link it below the bootstrap. css link. Then you can add your own classes and/or overwrite the Bootstrap classes in your own file.

Can I use Bootstrap for commercial use?

It permits you to:Freely download and use Bootstrap, in whole or in part, for personal, private, company internal, or commercial purposes.


1 Answers

Partially. If you avoid class names that are used by bootstrap, you should be fine. But bootstrap defines some tag-specific styles, such as

a {
  background-color: transparent
}

You can circumvent that by defining a style like that:

.without-bootstrap > a {
  /* whatever */
}

Example:

.wrapper {
  background-color:#f00;
}
.no-bootstrap > a {
  background-color:#fff;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet"/>
<div class="wrapper">
  <div class="no-bootstrap">
    <a href="#"> No Bootstrap</a>
    <div class="bootstrap">
      <a href="#"> With Bootstrap</a>
    </div>
  </div>
</div>

Another solution might be to customize bootstrap for your needs: http://getbootstrap.com/customize/

like image 163
mmgross Avatar answered Oct 06 '22 03:10

mmgross