2016-07-15 78 views
-1

我有以下的標記:對齊glyphicon與標籤

<div class="row"> 
    <div class="col-xs-6"> 
     <label class="labelTextFormat">Tags</label> 
     <button><span class="glyphicon glyphicon-edit" style=""></span></button> 
     <button><span class="glyphicon glyphicon-plus" style=""></span></button> 
    </div> 
</div> 

這給了我下面的輸出:

Glyphicon

我想旁邊的標籤顯示它們。我應該怎麼做?

Codepen Demo

+0

風格你的元素是'display:inline-block;' –

+0

其工作正常。請正確地闡述事情... – vignesh

+0

@Paulie:http://codepen.io/anon/pen/AXxxQy – Noob

回答

1

label是100%的寬

刪除

.labelTextFormat { 
    font-weight: normal; 
    font-size: 18px; 
    color: #a1ebff; 
    padding-top: 6px; 
    float: left; 
} 

.labelTextFormat { 
 
     font-weight: normal; 
 
     font-size: 18px; 
 
     color: #a1ebff; 
 
     padding-top: 6px; 
 
     float: left; 
 
    }
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/> 
 
<div class="row"> 
 
    <div class="col-xs-6"> 
 
    <label class="labelTextFormat">Tags</label> 
 
    <button><span class="glyphicon glyphicon-edit" style=""></span></button> 
 
    <button><span class="glyphicon glyphicon-plus" style=""></span></button> 
 
    </div> 
 
</div>

-1
<button class="btn btn-success" data-toggle="modal" data-target="#myModalNorm" type="button"> 
<i class="glyphicon glyphicon-plus"></i>Tags</button> 
+1

儘管這段代碼可能會解決這個問題,[其中包括解釋](// meta.stackexchange.com/questions/114762/explaining-entirely-code-based-answers)真的有助於提高您的帖子的質量。請記住,您將來會爲讀者回答問題,而這些人可能不知道您的代碼建議的原因。也請儘量不要使用解釋性註釋來擠佔代碼,因爲這會降低代碼和解釋的可讀性! – FrankerZ