你必須同時包含文件和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>
您必須同時添加JS和CSS的引導,使其正常工作。 – asharajay
@asharajay ---這是基於你的經驗還是記錄在某個地方?我查看Bootstrap網站,找不到任何說明。在我看來,如果你打算使用需要該文件的組件,那麼只需要包含''bootstrap.min.js'''。 –
不清楚?這個問題很愚蠢,但很清楚。 – amdev