2013-12-11 23 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>