Bootstrap Glyphicon没有显示在网站的一个部分,但在其他部分

时间:2018-02-02 16:37:14

标签: twitter-bootstrap glyphicons

我在某些文字下方的一个中间行添加了一个glyphicon。之后他们应该提供一个与帖子互动的按钮。但后来他们只是没有展示。为了测试它们是否一般不显示我在左行添加了另一个,它在哪里工作,但为什么?

代码:

<body>
    <div id="navbar">
        <nav class="navbar navbar-inverse navbar-fixed-top">
            <div class="container-fluid">
                <div class="navbar-header">
                    <a class="navbar-brand" href="#">Sample</a>
                </div>
                <ul class="nav navbar-nav">
                    <li class="active">
                        <a href="#">Home</a>
                    </li>
                    <li>
                        <a href="#">My Profile</a>
                    </li>
                    <li>
                        <a href="#">Sample Text</a>
                    </li>
                    <li>
                        <a href="#">Sample Text</a>
                    </li>
                </ul>
            </div>
        </nav>
    </div>
    <div class="row">
        <div class="col-sm-4">
            <div>
                <p>It is working here: </p>
                <span class="glyphicon glyphicon-envelope">
            </div>
        </div>
        <div class="col-sm-4">
            <div class="well">
                <div class="form-group">
                    <input id="tweetInput" type="text" class="form-control" id="usr" placeholder="Whazzup?">
                    <button id="tweetButton" type="button" class="btn btn-primary"> Primary </button>
                </div>
            </div>
            <div class="well">
                <div>
                    <h3>Lukas
                        <small>vor 5 Minuten</small>
                    </h3>
                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit Ut enim ad minim veniam, quis nostrud exercitation
                        ullamco laboris... </p>
                </div>
                <div>
                    But not here!?
                    <span class="glyphicons glyphicons-envelope"></span>
                    <span class="glyphicons glyphicons-envelope"></span>

                </div>
            </div>
            <div class="well">
                <h3>John
                    <small>vor 7 Minuten</small>
                </h3>
                <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit Ut enim ad minim veniam, quis nostrud exercitation
                    ullamco laboris... </p>
            </div>
            <div class="well">

        <div class="col-sm-4">.col-sm-4</div>
    </div>


</body>

1 个答案:

答案 0 :(得分:0)

图标中的glyphicon类名称错误。还注意到代码中没有关闭几个div标签。

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


<body>
  <div id="navbar">
    <nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container-fluid">
        <div class="navbar-header">
          <a class="navbar-brand" href="#">Sample</a>
        </div>
        <ul class="nav navbar-nav">
          <li class="active">
            <a href="#">Home</a>
          </li>
          <li>
            <a href="#">My Profile</a>
          </li>
          <li>
            <a href="#">Sample Text</a>
          </li>
          <li>
            <a href="#">Sample Text</a>
          </li>
        </ul>
      </div>
    </nav>
  </div>
  <div class="row">
    <div class="col-sm-4">
      <div>
        <p>It is working here: </p>
        <span class="glyphicon glyphicon-envelope">
            </div>
        </div>
        <div class="col-sm-4">
            <div class="well">
                <div class="form-group">
                    <input id="tweetInput" type="text" class="form-control" id="usr" placeholder="Whazzup?">
                    <button id="tweetButton" type="button" class="btn btn-primary"> Primary </button>
                </div>
            </div>
            <div class="well">
                <div>
                    <h3>Lukas
                        <small>vor 5 Minuten</small>
                    </h3>
                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit Ut enim ad minim veniam, quis nostrud exercitation
                        ullamco laboris... </p>
                </div>
                <div>
                    But not here!?
                    <span class="glyphicon glyphicon-envelope"></span>
        <span class="glyphicons glyphicon-envelope"></span>

      </div>
    </div>
    <div class="well">
      <h3>John
        <small>vor 7 Minuten</small>
      </h3>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris... </p>
    </div>
    <div class="well">

      <div class="col-sm-4">.col-sm-4</div>
    </div>

  </div>
  </div>
  </div>
</body>