Glyphicon里面的按钮不可见

时间:2017-03-28 08:43:22

标签: twitter-bootstrap glyphicons

我想将glyphicon放在按钮内。我不知道为什么它不可见。唯一可见的是文本,但不是glyphicon。

Here就是一个例子。问题出在这个按钮上:

<button type="button" class="btn btn-primary">
<span class="glyphicon glyphicon-arrow-up"></span>3</button>

2 个答案:

答案 0 :(得分:3)

&#13;
&#13;
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<button type="button" class="btn btn-primary">
<span class="glyphicon glyphicon-arrow-up"></span> 3 </button>
&#13;
&#13;
&#13;

答案 1 :(得分:1)

使用w3schools的工作示例

&#13;
&#13;
<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>

<div class="container">
  <h2>Glyphicon Examples</h2>
 
    <button type="button" class="btn btn-primary">
      <span class="glyphicon glyphicon-arrow-up"></span> 3
    </button>
  
</div>

</body>
</html>
&#13;
&#13;
&#13;