Boostrap崩溃无法正常工作

时间:2018-04-12 13:39:29

标签: twitter-bootstrap forms

尝试在表单中使用Boostrap崩溃,但它没有响应。复制&直接从Boostrap网站粘贴,但仍无效。请帮忙!

<a class="btn btn-primary" data-toggle="collapse" href="#collapseExample" role="button" data-target="firstname" aria-expanded="false" aria-controls="collapseExample">
   Test
 </a>
<form>
  <div class="form-row mb-1 collapse" id="firstname">
    <div class="form-group col-md-6">
      <input type="email" class="form-control" placeholder="Legal first name">
    </div>
  </div>
  <div class="form-group col-md-6">
    <input type="password" class="form-control" id="inputPassword4" placeholder="Legal last name">
  </div>
</div>
  </form>

1 个答案:

答案 0 :(得分:1)

您错过了要切换的元素中的id = "collapseExample"data-target="#collapseExample" https://getbootstrap.com/docs/4.0/components/collapse/