没有不值得去解决的问题,也没有不值得去学习的技术!

Install Bootstrap v3.3.7 via npm

On a Bootstrap-based page, open the Run Bootlint bookmark. A popup will appear notifying you whether any issues were detected. If there are issues, open the developer tools and select the Console tab

1. Install v3 via npm, as shown in Figure 1
npm install bootstrap@3

Install v3 via npm
Figure 1

2. Install Grunt to compile the CSS and JavaScript files. Because npm is slow, I ultimately chose cnpm, as shown in Figure 2
(1) Install grunt-cli in the global environment: npm install -g grunt-cli
(2) Navigate to the /bootstrap/ root directory, then run the cnpm install command. npm will read the package.json file and automatically install all the dependent extension packages listed in it.

Install Grunt to compile the CSS and JavaScript files. Because npm is slow, I ultimately chose cnpm
Figure 2

3. Run the grunt dist command to compile only the CSS and JavaScript files, as shown in Figure 3

Run the grunt dist command to compile only the CSS and JavaScript files
Figure 3

4. Install Bootlint, which is the officially supported HTML linter for Bootstrap, as shown in Figure 4
cnpm install -g bootlint

Install Bootlint, which is the officially supported HTML linter for Bootstrap
Figure 4

5. Run the check from the command line, as shown in Figure 5
bootlint index.html

Run the check from the command line
Figure 5

6. Run Bootlint in the browser. For reference, see: https://github.com/twbs/bootlint , as shown in Figure 6
(1) Create a new bookmark in your browser
(2) Set the name: Run Bootlint
(3) Set the URL:
javascript:(function(){var s=document.createElement(“script”);s.onload=function(){bootlint.showLintReportForCurrentDocument([]);};s.src=”https://maxcdn.bootstrapcdn.com/bootlint/latest/bootlint.min.js”;document.body.appendChild(s)})();

7. On a Bootstrap-based page, open the Run Bootlint bookmark. A popup will appear notifying you whether any issues were detected. If there are issues, open the developer tools and select the Console tab, as shown in Figure 7

On a Bootstrap-based page, open the Run Bootlint bookmark. A popup will appear notifying you whether any issues were detected. If there are issues, open the developer tools and select the Console tab
Figure 7

关于作者 · 持续学习与技术实践

我是一名拥有 15 年以上开发经验的技术从业者,自 2013 年起持续运营个人技术博客,记录工作与个人项目中遇到的真实问题,以及解决问题过程中的探索、实践和思考。

除了技术写作,我也在持续开发和维护自己的独立项目,探索新技术和新工具在实际场景中的应用。我始终相信,没有不值得去解决的问题,也没有不值得去学习的技术。

如果这篇文章对你有所帮助,欢迎浏览博客中的其他文章,也欢迎交流技术经验与想法。

关于我  ·  GitHub  ·  邮件联系