1

下面我列出了我的头部链接和页面底部的链接。模式没有加载,我不知道为什么,我相信这是我链接文件的问题。

头部链接:

   <link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
   <link href="css/carousel.css" rel="stylesheet">

页脚:

<a data-toggle="modal" href="#myModal" class="btn btn-primary btn-lg">Launch demo modal</a>


<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
  <div class="modal-content">
    <div class="modal-header">
      <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
      <h4 class="modal-title">Modal title</h4>
    </div>
    <div class="modal-body">
      ...
    </div>
    <div class="modal-footer">
      <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      <button type="button" class="btn btn-primary">Save changes</button>
    </div>
  </div>
</div>

页脚下方的链接:

<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css"   rel="stylesheet">
<!-- 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="assets/js/bootstrap.js"></script>
4

1 回答 1

2

这是一个几乎与您完全相同的 HTML 的工作jsFiddle,唯一的区别是我链接到 jQuery、Bootstrap 3 CSS 和 Bootstrap 3 JS 的 CDN 版本

  • 正如其他人所建议的那样,仔细检查所有 CSS 和 JS 文件实际上正在加载,并且没有路径问题
  • 检查您的所有 Bootstrap CSS 和 JS 文件是否一致并且对于 Bootstrap 3
  • 注释掉 carousel.css 文件,以验证那里没有冲突

HTML

<a data-toggle="modal" href="#myModal" class="btn btn-primary btn-lg">Launch demo modal</a>


<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;    </button>
  <h4 class="modal-title">Modal title</h4>
</div>
<div class="modal-body">
  ...
</div>
<div class="modal-footer">
  <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  <button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
于 2013-09-16T11:03:14.123 回答