Should I include bootstrap.css and bootstrap-respo

2020-02-20 06:10发布

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" />

3条回答
迷人小祖宗
2楼-- · 2020-02-20 06:30

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
查看更多
男人必须洒脱
3楼-- · 2020-02-20 06:40

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"/>
查看更多
手持菜刀,她持情操
4楼-- · 2020-02-20 06:47

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!

查看更多
登录 后发表回答