twitter-bootstrap bootstrap.css vs bootstrap.js 我应该使用哪一个?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18977493/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
bootstrap.css vs bootstrap.js which one should I use?
提问by exAres
What is the difference between these two. I downloaded bootstrap.zip and I got both css and js files. Which one should I include in html?
这两者有什么区别。我下载了 bootstrap.zip 并且得到了 css 和 js 文件。我应该在 html 中包含哪一个?
If I include bootstrap.css, will it affect my own app.css? How to make use of both bootstrap.css and my own app.css together?
如果我包含 bootstrap.css,它会影响我自己的 app.css 吗?如何同时使用 bootstrap.css 和我自己的 app.css?
As I was totally unaware of how to use css and js in HTML, I asked this question. But now I have understood that I need to include both bootstrap.css and bootstrap.js in my index.html. I also have figured out how to use them.
由于我完全不知道如何在 HTML 中使用 css 和 js,所以我问了这个问题。但现在我明白我需要在 index.html 中同时包含 bootstrap.css 和 bootstrap.js。我也想出了如何使用它们。
采纳答案by Donovan Charpin
You have two differents bootstrap lib. One with CSS and one with JS.
你有两个不同的引导程序库。一种使用 CSS,一种使用 JS。
The CSS lib contain base of bootstrap style : http://getbootstrap.com/2.3.2/base-css.html
CSS 库包含引导程序样式的基础:http: //getbootstrap.com/2.3.2/base-css.html
And the js contain some graphics components and animations : http://getbootstrap.com/2.3.2/components.html
并且 js 包含一些图形组件和动画:http: //getbootstrap.com/2.3.2/components.html
回答by Girish Thimmegowda
You have to include both files and also jquery.
您必须同时包含文件和 jquery。
Please go through the bootstrap documentationand sample codes.
请阅读引导程序文档和示例代码。
This is how your basic webpage with bootstrap looks like.
这就是带有 bootstrap 的基本网页的样子。
<!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>

