You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

67 line
4.0 KiB

  1. <div class="bs-docs-section">
  2. <h1 id="glyphicons" class="page-header">Glyphicons</h1>
  3. <h2 id="glyphicons-glyphs">Available glyphs</h2>
  4. <p>Includes 200 glyphs in font format from the Glyphicon Halflings set. <a href="http://glyphicons.com/">Glyphicons</a> Halflings are normally not available for free, but their creator has made them available for Bootstrap free of cost. As a thank you, we only ask that you include a link back to <a href="http://glyphicons.com/">Glyphicons</a> whenever possible.</p>
  5. <div class="bs-glyphicons">
  6. <ul class="bs-glyphicons-list">
  7. {% for iconClassName in site.data.glyphicons %}
  8. <li>
  9. <span class="glyphicon {{ iconClassName }}"></span>
  10. <span class="glyphicon-class">glyphicon {{ iconClassName }}</span>
  11. </li>
  12. {% endfor %}
  13. </ul>
  14. </div>
  15. <h2 id="glyphicons-how-to-use">How to use</h2>
  16. <p>For performance reasons, all icons require a base class and individual icon class. To use, place the following code just about anywhere. Be sure to leave a space between the icon and text for proper padding.</p>
  17. <div class="bs-callout bs-callout-danger">
  18. <h4>Don't mix with other components</h4>
  19. <p>Icon classes cannot be directly combined with other components. They should not be used along with other classes on the same element. Instead, add a nested <code>&lt;span&gt;</code> and apply the icon classes to the <code>&lt;span&gt;</code>.</p>
  20. </div>
  21. <div class="bs-callout bs-callout-danger">
  22. <h4>Only for use on empty elements</h4>
  23. <p>Icon classes should only be used on elements that contain no text content and have no child elements.</p>
  24. </div>
  25. <div class="bs-callout bs-callout-info">
  26. <h4>Changing the icon font location</h4>
  27. <p>Bootstrap assumes icon font files will be located in the <code>../fonts/</code> directory, relative to the compiled CSS files. Moving or renaming those font files means updating the CSS in one of three ways:</p>
  28. <ul>
  29. <li>Change the <code>@icon-font-path</code> and/or <code>@icon-font-name</code> variables in the source Less files.</li>
  30. <li>Utilize the <a href="http://lesscss.org/usage/#command-line-usage-relative-urls">relative URLs option</a> provided by the Less compiler.</li>
  31. <li>Change the <code>url()</code> paths in the compiled CSS.</li>
  32. </ul>
  33. <p>Use whatever option best suits your specific development setup.</p>
  34. </div>
  35. {% highlight html %}
  36. <span class="glyphicon glyphicon-search"></span>
  37. {% endhighlight %}
  38. <h2 id="glyphicons-examples">Examples</h2>
  39. <p>Use them in buttons, button groups for a toolbar, navigation, or prepended form inputs.</p>
  40. <div class="bs-example">
  41. <div class="btn-toolbar" role="toolbar">
  42. <div class="btn-group">
  43. <button type="button" class="btn btn-default"><span class="glyphicon glyphicon-align-left"></span> <span class="sr-only">Left Align</span></button>
  44. <button type="button" class="btn btn-default"><span class="glyphicon glyphicon-align-center"></span> <span class="sr-only">Center Align</span></button>
  45. <button type="button" class="btn btn-default"><span class="glyphicon glyphicon-align-right"></span> <span class="sr-only">Right Align</span></button>
  46. <button type="button" class="btn btn-default"><span class="glyphicon glyphicon-align-justify"></span> <span class="sr-only">Justify</span></button>
  47. </div>
  48. </div>
  49. <div class="btn-toolbar" role="toolbar">
  50. <button type="button" class="btn btn-default btn-lg"><span class="glyphicon glyphicon-star"></span> Star</button>
  51. <button type="button" class="btn btn-default"><span class="glyphicon glyphicon-star"></span> Star</button>
  52. <button type="button" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-star"></span> Star</button>
  53. <button type="button" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-star"></span> Star</button>
  54. </div>
  55. </div>
  56. {% highlight html %}
  57. <button type="button" class="btn btn-default btn-lg">
  58. <span class="glyphicon glyphicon-star"></span> Star
  59. </button>
  60. {% endhighlight %}
  61. </div>