2013-09-24 37 views
3

這兩者有什麼區別。我下載了bootstrap.zip並獲得了css和js文件。我應該在html中包含哪一個?bootstrap.css vs bootstrap.js我應該使用哪一個?

如果我包含bootstrap.css,它會影響我自己的app.css嗎?如何同時使用bootstrap.css和我自己的app.css?

由於我完全不知道如何在HTML中使用css和js,我問了這個問題。 但現在我明白了,我需要在我的index.html中包含bootstrap.css和bootstrap.js。我也想出瞭如何使用它們。

+1

您必須同時添加JS和CSS的引導,使其正常工作。 – asharajay

+0

@asharajay ---這是基於你的經驗還是記錄在某個地方?我查看Bootstrap網站,找不到任何說明。在我看來,如果你打算使用需要該文件的組件,那麼只需要包含''bootstrap.min.js'''。 –

+0

不清楚?這個問題很愚蠢,但很清楚。 – amdev

回答

6

你必須同時包含文件和jQuery。

請仔細閱讀bootstrap documentation和示例代碼。

這就是你的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> 
相關問題