doniyor
doniyor

Reputation: 37934

Can I use only certain elements of Twitter Bootstrap?

Can I use only some certain elements of bootstrap library? For example, if I import the whole library, my page breaks because of conflicts between my CSS and Bootstrap's CSS; they are overwriting each other's properties.

If possible, I want something like just the button and div styling properties of the Bootstrap library.

Upvotes: 20

Views: 19972

Answers (2)

Pigueiras
Pigueiras

Reputation: 19356

You can download whatever you need in the customized download of Twitter Bootstrap page. Just select whatever you need and click on download.

Also you can go to the project official repository, download all the less files, and compile only what is necessary for you, commenting the lines of the files that you don't need in the bootstrap.less file.

Upvotes: 32

NielsC
NielsC

Reputation: 344

Well I suggest you take the specific CSS rules out of the bootstrap CSS file and place them in your own CSS file, because it's kind of useless if you include the whole bootstrap CSS file in your website and then just 1 or 2 CSS rules of it.

You could also try to place the bootstrap CSS file first and then your CSS file after it in the HEAD section of your website. Usually your CSS file will be "more important" and then the specific styles which are applied by bootstrap will be overridden with your own rules.

<link bootstrap css definition />
<link your css definition />

Upvotes: 5

Related Questions