我正在尝试将数据切换和数据目标添加到类中,但是它不起作用。我已经制作了一个使用javascript,css和bootstrap的html文件。 这是代码。
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<title>Portfolio</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<header>
<div class="container">
<div class="row no-gutters">
<div class="col-lg-4 col-md-4">
<img src="img/profile pic.png">
</div>
<div class="col-lg-8 col-md-8">
<div class="d-flex flex-column">
<div class="p-5 bg-dark text-white">
<div class="d-flex flex-row justify-content-between align-items-center">
<h1 class="display-4"> Jordan Rai </h1>
<div> <i class="fa fa-github fa-2x"></i> </div>
<div> <i class="fa fa-linkedin-square fa-2x"></i> </div>
</div>
</div>
<div class="p-3 text-white bg-black">
Student (Senior) at the Pennslyvania State University
</div>
<div class="d-flex flex-row text-center text-white align-items-start">
<div class="p-4 bg-success font-div" data-toggle="collapse" data-target="#home">
<i class="fa fa-home fa-2x d-block"></i> Home
</div>
<div class="p-4 bg-danger font-div">
<i class="fa fa-graduation-cap fa-2x d-block"></i> Resume
</div>
<div class="p-4 bg-primary font-div">
<i class="fa fa-folder fa-2x d-block"></i> Projects
</div>
<div class="p-4 bg-warning font-div">
<i class="fa fa-envelope fa-2x d-block"></i> Contact
</div>
</div>
</div>
</div>
</div>
</div>
</header>
<div class="container">
<div class="collapse id=" id="home">
<div class="p-5 text-white bg-success">
<h2>My Resume</h2>
</div>
</div>
</div>
<div class="container ">
<footer class="p-5 bg-dark text-center ">
<button class="btn ">
<i class="fa fa-download fa-2x d-block "></i> Download
</button>
</footer>
</div>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js " integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN " crossorigin="anonymous "></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js "></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js "></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js "></script>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js " integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN " crossorigin="anonymous "></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js " integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q " crossorigin="anonymous "></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js " integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl " crossorigin="anonymous "></script>
</body>
</html>
我不确定这是否是代码中依赖项和.js文件顺序的问题。但是当我运行文件“ home”时,它没有可折叠的栏。