twitter-bootstrap-3 – Bootstrap Glyphicons没有显示

前端之家收集整理的这篇文章主要介绍了twitter-bootstrap-3 – Bootstrap Glyphicons没有显示前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在使用bootstrap 3并且我将一个Glyphicons与输入文本放在一起并且Glyphicons没有显示(但是btn-info显示)我正在使用:class =“input-group”来包含glyphicon,输入文本和提交按钮.

这是代码

  1. <body>
  2. <nav class="navbar navbar-default" role="navigation">
  3. <div class="container">
  4. <!-- Brand and toggle get grouped for better mobile display -->
  5. <div class="navbar-header">
  6. <button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
  7. <span class="sr-only">Toggle navigation</span>
  8. <span class="icon-bar"></span>
  9. <span class="icon-bar"></span>
  10. <span class="icon-bar"></span>
  11. </button>
  12. <a class="navbar-brand" href="#">Meu Site</a>
  13. </div>
  14. <!-- Collect the nav links,forms,and other content for toggling -->
  15. <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
  16. <ul class="nav navbar-nav navbar-right">
  17. <li><a href="#">News</a></li>
  18. <li><a href="#">Login</a></li>
  19. <li><a href="#">Create Account</a></li>
  20. </ul>
  21. </div><!-- /.navbar-collapse -->
  22. </div><!-- /.container -->
  23. </nav>
  24.  
  25. <div class="container">
  26. <div class="row">
  27. <div class="span7 text-center col-md-4 col-md-offset-3" style="float: none; margin-left: auto;margin-right: auto;">
  28. <img src="../../app.images/logo.jpg" />
  29. </div>
  30. <form class="span7 text-center col-md-4 col-md-offset-3" style="float: none; margin-left: auto;margin-right: auto;" role="search">
  31. <div class="form-group">
  32. <label class="radio-inline"><input type="radio" name="optradio">Opt1</label>
  33. <label class="radio-inline"><input type="radio" name="optradio" checked="">Opt2</label>
  34. <label class="radio-inline"><input type="radio" name="optradio">Opt3</label>
  35. </div>
  36.  
  37. <div class="input-group">
  38. <a href="#" class="btn btn-info input-group-btn">
  39. <span class="glyphicon glyphicon-th"></span>
  40. </a>
  41. <input class="form-control " type="text" placeholder="Search" />
  42. <div class="input-group-btn">
  43. <button class="btn btn-default" type="submit">Search</button>
  44. </div>
  45. </div>
  46. </form>
  47. <div class="span7 text-center col-md-4 col-md-offset-3" style="float: none; margin-left: auto;margin-right: auto;">
  48. Slogan
  49. </div>
  50. <div class="span7 text-center col-md-4 col-md-offset-3" style="float: none; margin-left: auto;margin-right: auto;">
  51. <a href="#">Mobile</a>
  52. <a href="#">Addons</a>
  53. <a href="#">Contact</a>
  54. </div>
  55. </div>
  56. </div>
  57. </body>

解决方法

似乎是由.input-group-btn引起的.有一个规则将此元素的font-size设置为0.使用以下方法添加样式规则:
  1. div.container a.input-group-btn {
  2. font-size: 14px;
  3. }

Working sample

猜你在找的Bootstrap相关文章