2014-09-26 61 views
0

如何在輸入字段中放置圖形?輸入字段中的自舉圖形

<div class="form-group has-success has-feedback"> 
    <label class="col-sm-2 control-label" for="inputSuccess">Input with success and icon</label> 
    <div class="col-sm-10"> 
     <input type="text" class="form-control" id="inputSuccess"> 
     <span class="glyphicon glyphicon-ok form-control-feedback"></span> 
    </div> 
    </div> 

它位於輸入欄下方。

回答

1

要顯示輸入旁邊的標籤(而不是上面),您可以使用form-horizontal。如果你安排你的HTML這樣便圖標將出現在裏面輸入:

<form class="form-horizontal" role="form"> 
    <div class="form-group has-success has-feedback"> 
    <label class="control-label col-sm-2" for="inputSuccess">Input with success</label> 
    <div class="col-sm-10"> 
     <input type="text" class="form-control" id="inputSuccess"> 
     <span class="glyphicon glyphicon-ok form-control-feedback"></span> 
    </div> 
    </div> 
</form> 

這裏有一個bootply例如:http://www.bootply.com/rXcXvNn1ZD

+0

它的工作!捆綁的感謝。 – Ayesha 2014-09-26 11:26:20