Bootstrap未加载glyphicon

时间:2017-10-25 18:42:08

标签: twitter-bootstrap

我开始使用bootstrap并尝试添加glyphicon作为我的按钮,在我看来,我已按照bootstrap documentation上的说明执行此操作,但它只是不起作用

我的代码:

    <!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>My Game</title>
  <!--bootstrap -->
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb" crossorigin="anonymous">
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js" integrity="sha384-alpBpkh1PFOepccYVYDB4do5UnbKysX5WZXm3XxPqe5iKTfUKjNkCk9SaVuEZflJ" crossorigin="anonymous"></script>
  <!--jQuery-->
  <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.3/umd/popper.min.js" integrity="sha384-vFJXuSJphROIrBnz7yo7oB41mKfc8JzQZiCq4NCceLEaO4IHwicKwpJf9c9IpFgh" crossorigin="anonymous"></script>
</head>
<body>

  <section>
    <button type="button" class="btn btn-primary">
      <span class="glyphicon glyphicon-star"></span>
    </button>
  </section>

  <script src="game.js"></script>
</body>
</html>

我错过了什么?

1 个答案:

答案 0 :(得分:1)

请参考Bootstrap 4迁移文档:

https://getbootstrap.com/docs/4.0/migration/#components

Glyphicons没有加载,因为它们不再是Bootstrap CSS Framework的一部分。