【问题标题】:bootstrap.css vs bootstrap.js which one should I use? [closed]bootstrap.css vs bootstrap.js 我应该使用哪一个? [关闭]
【发布时间】:2013-09-24 09:19:31
【问题描述】:

这两者有什么区别。我下载了 bootstrap.zip,我得到了 css 和 js 文件。我应该在 html 中包含哪一个?

如果我包含 bootstrap.css,会不会影响我自己的 app.css?如何同时使用 bootstrap.css 和我自己的 app.css?

由于我完全不知道如何在 HTML 中使用 css 和 js,所以我问了这个问题。 但现在我明白了,我需要在 index.html 中同时包含 bootstrap.css 和 bootstrap.js。我也想出了如何使用它们。

【问题讨论】:

  • 您必须为引导程序添加 js 和 css 才能使其完美运行。
  • @asharajay --- 这是基于您的经验还是记录在某处?我查看了 Bootstrap 网站,找不到任何内容。在我看来,bootstrap.min.js 仅在您要使用需要该文件的组件时才需要包含在内。
  • 没有傻问题,但有新手问题。

标签: javascript css twitter-bootstrap


【解决方案1】:

你有两个不同的引导库。一种用 CSS,一种用 JS。

CSS 库包含引导样式的基础:http://getbootstrap.com/2.3.2/base-css.html

并且js包含一些图形组件和动画:​​http://getbootstrap.com/2.3.2/components.html

【讨论】:

    【解决方案2】:

    你必须包含两个文件和 jquery。

    请浏览bootstrap documentation 和示例代码。

    这就是您的带有引导程序的基本网页的样子。

    <!DOCTYPE html>
    <html>
    <head>
    <title>Bootstrap 101 Template</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
    
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="../../assets/js/html5shiv.js"></script>
      <script src="../../assets/js/respond.min.js"></script>
    <![endif]-->
     </head>
     <body>
    <h1>Hello, world!</h1>
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="//code.jquery.com/jquery.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="js/bootstrap.min.js"></script>
     </body>
    </html>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-08-27
      • 1970-01-01
      • 2011-07-26
      • 1970-01-01
      • 1970-01-01
      • 2011-03-13
      • 2012-08-22
      • 1970-01-01
      相关资源
      最近更新 更多