为什么bootstraps glyphicons打破了元素?

时间:2013-09-30 15:32:35

标签: html twitter-bootstrap fonts slim

我尝试了两种不同的变体:

  td
    span.glyphicon.glyphicon-chevron-up 
    span    Search

span_not_bootstrap

button#toggle_unimportant_search_params class=["btn", "btn-primary"]
  span.glyphicon.glyphicon-list
  span    Show all parameters

button_not_bootstrap

VS

  td
    span.glyphicon.glyphicon-chevron-up Search

span_bootstrap

button#toggle_unimportant_search_params class=["btn", "btn-primary"]
  span.glyphicon.glyphicon-list Show all parameters

button_bootstrap

所以看起来附加span    的变体看起来更好。但这不是我所知道的引导方式。引导方式是:

<button type="button" class="btn btn-default btn-lg">
  <span class="glyphicon glyphicon-star"></span> Star
</button>

1 个答案:

答案 0 :(得分:0)

对于这些元素使用slim语法的正确形式将是:

td
  span.glyphicon.glyphicon-chevron-up 
  |  Search

button#toggle_unimportant_search_params class=["btn", "btn-primary"] type="button"
  span.glyphicon.glyphicon-list
  |  Show all parameters