将 Bootstrap 更新到版本 3 - 我该怎么做? [英] Updating Bootstrap to version 3 - what do I have to do?

查看:45
本文介绍了将 Bootstrap 更新到版本 3 - 我该怎么做?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Bootstrap 的新手,使用的是旧版本 2.3.2.

I'm new to Bootstrap and have the older version 2.3.2.

第 3 版已发布.如果我想使用最新版本,我是否只是简单地替换 CSS 和 Javascript 文件?

Version 3 has been released. Do I just simply replace the CSS and Javascript files if I want to use the latest version?

推荐答案

  1. http://getbootstrap.com/ 下载最新版本或替换 css 和 js使用最新版本的文件或使用 CDN (http://www.bootstrapcdn.com/)

  1. Download the latest version from http://getbootstrap.com/ OR Replace the css and js files with the newest versions or use CDN (http://www.bootstrapcdn.com/)

迁移您的 html,确实阅读 http://bootply.com/bootstrap-3-迁移指南.你可以试试 http://twitterbootstrapmigrator.w3masters.nl/http://code.divshot.com/bootstrap3_upgrader/(也提供清单)

Migrate your html, yes indeed read http://bootply.com/bootstrap-3-migration-guide. You could try http://twitterbootstrapmigrator.w3masters.nl/ or http://code.divshot.com/bootstrap3_upgrader/ (provide checklist too)

删除 html5shiv 导致 TB 放弃对 IE7 和 Firefox 3.x 的支持 添加 html5shiv.js 以向 IE8 添加对 HTML5 元素的支持

remove html5shiv cause TB drops support for IE7 and Firefox 3.x add html5shiv.js to add support of HTML5 elements to IE8

添加 respond.js (https://github.com/scottjehl/Respond) 用于 IE 中的媒体查询支持.注意这不适用于 CDN,请参阅:Twitter Bootstrap 3 的 IE8 问题

add respond.js (https://github.com/scottjehl/Respond) for media query support in IE. NOTE this won't work with CDN, see: IE8 issue with Twitter Bootstrap 3

如果您使用 Glyphicons,则必须从 http://glyphicons 添加它们.getbootstrap.com/(图标已移至单独的存储库.) 自 RC2 起 Glyphicon 又回来了(Glyphicon Halflings 集的字体格式中有 180 个字形)

If you use Glyphicons, you will have to add them from http://glyphicons.getbootstrap.com/ ( icons have been moved to a separate repository.) Glyphicons are back since RC2 (180 glyphs in font format from the Glyphicon Halflings set)

如果您使用 Javascript Typeahead 组件,则必须集成 https://github.com/twitter/typeahead.js/(因为 typeahead javascript 被丢弃)另见:Bootstrap 3.0 RC1 的 Typeahead 问题 或使用旧"插件:https://github.com/bassjobsen/Bootstrap-3-Typeahead,另见:https://stackoverflow.com/questions/18615964/ajax-call-in-bootstrap-3-0-typeahead/18620473

If you use the Javascript Typeahead component, you will have to integrate https://github.com/twitter/typeahead.js/ (cause typeahead javascript is dropped) See also: Typeahead problems with Bootstrap 3.0 RC1 Or use the "old" plugin: https://github.com/bassjobsen/Bootstrap-3-Typeahead, see also: https://stackoverflow.com/questions/18615964/ajax-call-in-bootstrap-3-0-typeahead/18620473

切换到最新版本的 jQuery 1.x(不要使用 2.x 版本导致 jQuery 2.x 不支持 IE8)

Switch to the latest version of jQuery 1.x (don't use the 2.x version cause jQuery 2.x don't support IE8)

如果您使用在代码中添加或插入 html 的第三方小部件(例如 addthis.com、sharethis.com 和 Google 地图),请为框大小创建包装器,请参阅:Twitter 的 Bootstrap 3 缺少 AddThis 计数器的右边框

If you use third party widgets which adds or insert html to your code (like addthis.com, sharethis.com and Google maps), create a wrapper for the box-sizing, see: Right border of the AddThis counter missing with Twitter's Bootstrap 3

其他:

Bootstrap 3 切换到 box-sizing:border-box 为什么?:https://stackoverflow.com/a/18858771/1596547

Bootstrap 3 switch to box-sizing: border-box why?: https://stackoverflow.com/a/18858771/1596547

已取消对 IE7 的注释支持.https://github.com/coliff/bootstrap-ie7 尝试重新添加 css 部分使用一些条件 CSS.

Note support for IE7 has been dropped. https://github.com/coliff/bootstrap-ie7 try to add the css part back with use of some conditional CSS.

这篇关于将 Bootstrap 更新到版本 3 - 我该怎么做?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆