简体   繁体   中英

Why is the boostrap widget not showing up?

I'm trying to implement a date picker into my website using boostrap. I've never used it before, I don't understand the error that keeps coming up.

.html file:

<link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="/bower_components/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css" />
<link rel="stylesheet" href="stylesheets/sidebar.css">
<link rel="stylesheet" href="stylesheets/taskboard.css">

<script src="javascripts/taskboard.js"> </script>
<script type="text/javascript" src="/bower_components/jquery/jquery.min.js"></script>
<script type="text/javascript" src="/bower_components/moment/min/moment.min.js"></script>
<script type="text/javascript" src="/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/bower_components/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js"></script> 
.
.
.
<div style="overflow:hidden; z-index:100;">
          <div class="form-group">
            <div class="row">
              <div class="col-md-8">
                <div id="datetimepicker12"></div>
              </div>
            </div>
          </div>
          <script type="text/javascript">
            $(function () {
            $('#datetimepicker12').datetimepicker({
                inline: true,
                sideBySide: true
              });
            });
          </script>
        </div>
      </div>

Nothing shows when I load the website, it stays empty and I get a console messsage saying: 在此处输入图像描述

your code is working perfectly fine with cdn

here is the JSFIDDLE link

You should double check whether the css files are in the correct location.

If they are then you can try few solutions here

  1. Try removing the rel="stylesheet" property and adding type="text/html" in the link tag.

  2. If the first solution didn't work then you can try keeping rel="stylesheet" and additionally add the type="text/css"

  3. if both of the above mentioned solution didn't work then you try adding <base href="/"> before your link tags

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM