2013-12-11 22 views
0

enter image description here我正在使用twitter引導庫來設計一個頁面,不幸的是,我的註冊按鈕沒有將中心與其他元素對齊。任何想法我做錯了什麼?爲什麼我的按鈕不對齊我的表單的中心?

<!DOCTYPE html> 
<html lang="en"> 
    <head> 
<meta charset="utf-8"> 
<meta name="viewport" content="width=device-width, initial-scale=1.0"> 
<meta name="description" content="Login form"> 
<meta name="me" content="Med Ayman"> 
<title>Bootbusiness | Give unique title of the page here</title> 
<!-- Bootstrap --> 
<link href="css/bootstrap.min.css" rel="stylesheet"> 
<!-- Bootstrap responsive --> 
<link href="css/bootstrap-responsive.min.css" rel="stylesheet"> 
<!-- Font awesome - iconic font with IE7 support --> 
<link href="css/font-awesome.css" rel="stylesheet"> 
<link href="css/font-awesome-ie7.css" rel="stylesheet"> 
<!-- Bootbusiness theme --> 
<link href="css/nehalem.css" rel="stylesheet"> 
<!--responsive images--> 
<link href="css/responsive.css" rel="stylesheet"> 

<img class="myimg" src="img/logo.png" alt="my logo"/> 

<form class="well span4" align="center"> 
    <input type="text" class="span3" placeholder="Username"/><br/> 
    <input type="password" class="span3" placeholder="Password"/><br/> 
    <button class="btn btn-primary span3">Sign in</button> 
</form> 

+0

請發表您的非自舉CSS代碼 – scrblnrd3

+0

有沒有可能得到一些什麼問題的屏幕截圖? – AVP

+1

按鈕元素的三個類中的一些具有'float'屬性,找到它並將其刪除或向按鈕添加新類並刪除這三個類。 – mdesdev

回答

0

按鈕實際上被對準中心,形式輸入不是。檢查其他任何造型的那些,或適用於像這樣的輸入:

display: block; margin: 0px auto; 
0

這種方式可以實現

<img class="myimg" src="img/logo.png" alt="my logo"/> 
<div class="col-sm-6 col-sm-offset-3 well"> 
<form class=""> 
    <div class="form-group"> 
     <label class="sr-only" for="form-username">Username</label> 
     <input type="text" class="form-control" placeholder="Username"/> 
    </div> 
    <div class="form-group"> 
     <label class="sr-only" for="form-password">Password</label> 
     <input type="password" class="form-control" placeholder="Password"/> 
    </div> 
    <button type="submit" class="btn btn-primary">Sign in</button> 
</form> 
</div>