Boostrap Css - 添加图标右侧并与文本大小对齐方面不同

问题描述:

我需要您的帮助以解决问题我想创建一些具有相同大小(无论文本)的按钮并在右上角添加箭头图标的按钮。 但是由于文本字符的数量,箭头与其他按钮不一致。 我使用的引导这里是代码:Boostrap Css - 添加图标右侧并与文本大小对齐方面不同

<div class="col-md-6"> 
<div class="item" style="text-align: center"> 
     <a class="btn btn-programs" style="width:230px" href="#">My 1st button with longer text<span class="btn-label"><i class="glyphicon glyphicon-chevron-right"></i></span></a> 
     </div> 
</p> 
<div class="item" style="text-align: center"> 
     <a class="btn btn-programs" style="width:230px" href="#">My 2nd Button <span class="btn-label"><i class="glyphicon glyphicon-chevron-right"></i></span></a> 
     </div> 
</p> 
</div> 
</div> 

使用类

BTN-块

<a class="btn btn-programs btn-block" href="#">My 1st button<span class="btn-label btn-block"><i class="glyphicon glyphicon-chevron-right"></i></span></a> 
+0

谢谢你的回答它不工作:( – scredi

添加以下CSS到您的网页

.item a span.btn-label 
    { 
    float: right; 
    } 
+0

谢谢你的回答,但文本将在右侧,这是非常丑陋的:s – scredi

+0

你会告诉我们你的预期o/p作为图像 –

+0

我发现我只需要做的解决方案浮动:在正确,它工作正常:)谢谢所有! – scredi