如何减少bootstrap glyphicons之间的间距

时间:2016-08-02 17:25:02

标签: html css twitter-bootstrap

我有两个字形,我希望彼此相邻,但它们之间有一些空间,我似乎无法摆脱它。

以下是它的外观:

enter image description here

这是我的代码:

    var temp = new DerivedEntity1 { 
                   BaseEntProp1 = "should be ignored", 
                   BaseEntProp2 = "this also should be ignored"};

    string tempJson = JsonConvert.SerializeObject(temp); 

的CSS:

    <div class="form-group" id="authForm">
        <span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
        <label id="authLabel" for="trash" style="visibility: hidden;">Trash</label>
    </div> <!-- end form-group -->
    <div class="form-group" id="authForm">
        <span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
        <label id="authLabel" for="trash" style="visibility: hidden;">Trash</label>
    </div> <!-- end form-group -->

2 个答案:

答案 0 :(得分:1)

#authForm减少或删除宽度

&#13;
&#13;
.glyphicon {
    font-size: 25px;
    vertical-align: middle;
}
#authForm {
    display:inline-block;
    width:30px;
}
&#13;
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="form-group" id="authForm">
        <span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
        <label id="authLabel" for="trash" style="visibility: hidden;">Trash</label>
    </div> <!-- end form-group -->
    <div class="form-group" id="authForm">
        <span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
        <label id="authLabel" for="trash" style="visibility: hidden;">Trash</label>
    </div> <!-- end form-group -->
&#13;
&#13;
&#13;

答案 1 :(得分:1)

简单地使用span,form-group是html表单元素所必需的。

  <link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet">

 <span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
 <span class="glyphicon glyphicon-trash" aria-hidden="true"></span>