Home >Web Front-end >Bootstrap Tutorial >How to install bootstrap

How to install bootstrap

藏色散人
藏色散人Original
2019-07-18 11:03:315247browse

How to install bootstrap

How to install bootstrap?

bootstrap installation method:

Install through Bower

You can also install and manage Bootstrap through Bower Less, CSS, JavaScript and font files.

$ bower install bootstrap

Installation through npm

You can also use the npm tool to install Bootstrap:

$ npm install bootstrap@3

require('bootstrap') The function of the code is Load all jQuery plugins for Bootstrap. Among them, the bootstrap module itself does not export anything. You can manually load a single Bootstrap plug-in by loading the /js/*.js files in the top-level directory of the installation package.

Bootstrap’s package.json file contains some additional metadata:

● less - the path to the entry Less file of Bootstrap source code

● style - the uncompressed version of Bootstrap Path to CSS file

Installation through Composer

You can also install the Bootstrap installation package through Composer (Chinese official website: Composer Chinese website), which includes Less, CSS, and JavaScript and fonts files:

$ composer require twbs/bootstrap

Things to note when compiling Less/Sass source code

Bootstrap uses Autoprefixer to automatically add vendor-specific prefixes to certain CSS properties. If you are compiling Bootstrap from Less/Sass source and are not using the Gruntfile that comes with Bootstrap, you must integrate Autoprefixer into your compilation tools and process. If you are using our pre-compiled Bootstrap files or the Gruntfile files we provide, then there is no need to worry, we have already done this for you.

Related recommendations: "bootstrap tutorial"

The above is the detailed content of How to install bootstrap. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn