Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap: How do I identify the Bootstrap version?

People also ask

How do I know if Bootstrap is used?

We can check Bootstrap-specific method is available or not. Syntax: var bootstrap = (typeof $(). "Bootstrap-specific method" == 'function');

How many versions are there in Bootstrap?

Originally released on August 19, 2011, we've since had over twenty releases, including two major rewrites with v2 and v3.

Can I use two versions of Bootstrap?

If it's just one feature, just copy the part of the . css from bootstrap 3.3 you want in its own css file and import this css file after the 2.2 version is loaded either in your build script or after your 2.2 version in your tag.


In the top of the bootstrap.css you should have comments like the below:

/*!
 * Bootstrap v2.3.1
 *
 * Copyright 2012 Twitter, Inc
 * Licensed under the Apache License v2.0
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Designed and built with all the love in the world @twitter by @mdo and @fat.
 */

If they are not there, then they have probably been deleted.

VERSIONS:

You can review version history here. Backward compatibility shouldn't be broken if the source is v2.0.0 (Jan 2012) and above. If it is prior to v2.0.0 there are details on upgrading here.


You can also check the bootstrap version via the javascript console in the browser:

$.fn.tooltip.Constructor.VERSION // => "3.3.7"

Credit: https://stackoverflow.com/a/43233731/1608226

Posting this here because I always come across this question when I forget to include JavaScript in the search and wind up on this question instead of the one above. If this helps you, be sure to upvote that answer as well.

Note: For older versions of bootstrap (less than 3 or so), you'll proably need to search the page's JavaScript or CSS files for the bootstrap version. Just came across this on an app using bootstrap 2.3.2. In this case, the (current) top answer is likely the correct one, you'll need to search the source code for the bootstrap find what version it uses. (Added 9/18/2020, though was in comment since 8/13/2020)


Method 1 - Very Simple

In Package.json - you'll see bootstrap package installed with version mentioned.

"dependencies": {
    // ...
   "bootstrap": "x.x.x"
    // ...
}

Method 2

  1. Open node_modules folder and under that
  2. Search and open bootstrap folder
  3. Now you'll be able to see version number in the following files
    • package.json
    • scss/bootstrap.scss or css/bootstrap.css
    • README.md

The Bootstrap version will be stated at the top of the CSS file. Simply open it and look at the top of the file.

e.g.

/*!
 * Bootstrap v2.3.0
 *
 * Copyright 2012 Twitter, Inc
 * Licensed under the Apache License v2.0
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Designed and built with all the love in the world @twitter by @mdo and @fat.
 */

An easy way to do this, without searching files or folders would be:

  • Open your web page on browser
  • press ctrl+U
  • search boostrap.min.js or boostrap.min.css, then click it (it would open source file)
  • at first line(commented) you should see boostrap version