2016-12-15 73 views
1

我正在使用bootstrap水平對齊方式,並且遇到了問題。
在此示例中,control-label類應該將標籤更靠近電子郵件輸入字段,但不會發生。Bootstrap - 爲什麼「control-label」類不會影響標籤?

問題是爲什麼?
預先感謝您!

您可以在的jsfiddle,在那裏你可以改變預覽窗口大小測試:https://jsfiddle.net/xm5kwyqo/


<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> 
 
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> 
 
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/> 
 

 

 

 
<div class="container"> 
 
    <div class="row"> 
 
    <section class="col-xs-12"> 
 

 
<form class="form-horisontal"> 
 
<div class="form-group"> 
 
    <label for="inputName">Name</label> 
 
    <input class="form-control" type="text" 
 
    id="inputName" placeholder="Name"> 
 
</div> 
 

 
<div class="form-group"> 
 
    <label class="col-sm-2 control-label" for="inputEmail">Email</label> 
 
<div class="col-sm-10"> 
 
    <input class="form-control" type="email" 
 
    id="inputEmail" placeholder="Email"> 
 
</div> 
 
</div> 
 

 
<div class="form-group"> 
 
    <label for="selectSite">Site</label> 
 
    <select class="form-control" id="selectSite"> 
 
    <option>Choose...</option> 
 
    <option>lynda.com</option> 
 
    <option>raybo.org</option> 
 
    <option>iviewsource.com</option> 
 
    </select> 
 
</div> 
 

 
<div class="checkbox"> 
 
    <label> 
 
    <input id="inputAddList" 
 
     type="checkbox">Add me to e-mail blast 
 
    </label> 
 
</div> 
 

 
<div class="form-group"> 
 
    <label for="inputComments">Comments</label> 
 
    <textarea class="form-control" 
 
    id="inputComments"></textarea> 
 
</div> 
 

 
<input type="submit" class="btn btn-default" 
 
    value="submit"> 
 
</form> 
 

 
    </section> 
 
    </div><!-- row --> 
 
</div><!-- content container -->

回答

1

這是一個誤拼寫問題。水平, horiSontal

替換:

<form class="form-horisontal"> 

通過:

<form class="form-horizontal"> 

的jsfiddle:https://jsfiddle.net/xm5kwyqo/1/

+0

我的壞,非常感謝你! :) – Rumata

+0

不客氣! –

相關問題