Html css3中文本输入框并排未对齐
我需要2个文本输入框并排在一页使用css3。我已经准备好了一切,除了第二个框在第一个输入框下面。如何在css中更正此问题 html:Html css3中文本输入框并排未对齐,html,css,Html,Css,我需要2个文本输入框并排在一页使用css3。我已经准备好了一切,除了第二个框在第一个输入框下面。如何在css中更正此问题 html: <div class="main"> <div class="one"> <div class="register"> <h3>Create your account</h3> <form id="reg-form"> <d
<div class="main">
<div class="one">
<div class="register">
<h3>Create your account</h3>
<form id="reg-form">
<div>
<div>
<label for="username">Username</label>
<input type="text" id="username" spellcheck="false" placeholder="User Name" />
</div>
<div>
<label for="password">Password</label>
<input type="password" id="password" />
</div>
<div>
<label></label>
<input type="submit" value="Shop Login" id="create-account" class="button"/>
</div>
</form>
</div>
</div>
<div class="two">
<div class="register">
<h3>Create your account</h3>
<form id="reg-form1">
<div>
<label for="name1">Name</label>
<input type="text" id="name1" spellcheck="false" placeholder="Enter Your Name"/>
</div>
<div>
<label for="email1">Email</label>
<input type="text" id="email1" spellcheck="false" placeholder="mymail@mail.com"/>
</div>
<div>
<label for="username1">Username</label>
<input type="text" id="username1" spellcheck="false" placeholder="User Name" />
</div>
<div>
<label for="password1">Password</label>
<input type="password" id="password1" />
</div>
<div>
<label for="password-again1">Password Again</label>
<input type="password" id="password-again1" />
</div>
<div>
<label></label>
<input type="submit" value="Create Account" id="create-account1" class="button"/>
</div>
</form>
</div>
</div>
</div>
我提供了一个
我要求它并排对齐,而不是像在演示中那样上下对齐。提前感谢您错过了
之前的一个结束div
。
添加结束div将使两个表单彼此相邻。
然后需要添加一点CSS规则,使两个表单完全垂直对齐:
div.one {
position: relative;
top: -165px
}
请参见此处的演示:没关系,总是很乐意帮助:)谢谢您的接受:)顺便问一下:)要求追加投票是否也太过分了?:)非常感谢:)
div.one {
position: relative;
top: -165px
}