2016-05-07 55 views
0

我正在与我的朋友创建网站。目前我们正在创建一个联系人页面,但我坚持将标签与输入框对齐。无法在Bootstrap中对齐标签并将其与文本框对齐3

http://imgur.com/qan9PpG

我ASP.net代码:链接到该页面

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> 
    <title>Contact</title> 
</asp:Content> 
<asp:Content ID="Content2" ContentPlaceHolderID="PageContent" runat="server"> 
    <div style="background-color: white; height: 750px;" class="container" id="contact-page"> 

     <label for="InputFullName">Full Name</label> 
     <input type="text" class="form-control" id="InputFullName" placeholder="Full Name"/> 


     <label for="InputEmail">Email address</label> 
     <input type="email" class="form-control" id="InputEmai" placeholder="[email protected]"/> 


     <label for="InputSubject">Subject</label> 
     <input type="text" class="form-control" id="InputSubject" placeholder="Subject"/> 


     <label for="InputDescription">Description</label> 
     <input type="text" class="form-control" id="InputDescription" placeholder="Description"/> 

     <div class="form-actions"> 
     <button type="submit" class="btn btn-default">Submit</button> 
     </div> 
    </div> 

</asp:Content> 

我的CSS文件:

/* Contact Page start */ 

#contact-page input { 
    display: block; 
    width: 450px; 
    float: none; 
    margin: 0 auto; 
    background-color: white; 
} 

#contact-page .btn btn-default { 
    float: none; 
    margin: 0 auto; 
} 

#contact-page #InputDescription { 
    height:250px 
} 

#contact-page label { 
    display: inline-block; 
    vertical-align: middle; 
    float: none; 
} 

/* Contact Page end */ 

我使用的引导3.

+0

在标签中添加行高作为输入框的高度 –

+0

它对您而言如何?你可以张贴截图吗? –

+0

https://gyazo.com/84e8ef9bcd416ac4fdccf5c4d741cf59这就是我看到它的atm。 –

回答

0

是否有可能使用文本框?

  <textarea name="message" rows="10" cols="30"> 
      Description 
      </textarea> 
+0

不用谢了,问题是我们想用文本框排列标签 –