2013-09-30 157 views
0

我嘗試了兩種不同的變體:爲什麼bootstraps glyphicons會破壞元素?

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> 

回答

0

使用超薄語法的元素正確的形式是:

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