Should I include bootstrap.css and bootstrap-responsive.css together?

十年热恋 提交于 2019-12-03 18:59:25

问题


Should I include two css file or one is enough?

<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css" media="all" />
<link rel="stylesheet" href="bootstrap/css/bootstrap-responsive.min.css" media="all" />

OR

<link rel="stylesheet" href="bootstrap/css/bootstrap-responsive.min.css" media="all" />

回答1:


Bootstrap 2

You should include both, the first one defines all the styles for html elements whilst the second one adds responsiveness to the layout.

Bootstrap 3

Only one css file will be included.

Happy coding!




回答2:


Both of the files should be included as of Bootstrap 2.


But with Bootstrap 3 only one css file will be included.

Responsive CSS is no longer separate and all responsive features are now compiled into the core bootstrap.css file near. Separate files are no longer required, and have thus been removed

Source: https://github.com/twitter/bootstrap/pull/6342

Edit: If you want to include bootstrap 3 css you can use this CDN version:

<link rel="stylesheet" type="text/css" 
   href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"/>



回答3:


You can use the official Twitter Bootstrap download helper in order to have one CSS file named bootstrap.css (resp. bootstrap.min.css) which will contain the following CSS parts:

  • Scaffolding
  • Base CSS
  • Components
  • JS Components
  • Miscellaneous
  • Responsive


来源:https://stackoverflow.com/questions/11455222/should-i-include-bootstrap-css-and-bootstrap-responsive-css-together

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!