Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/77.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html css3中文本输入框并排未对齐_Html_Css - Fatal编程技术网

Html css3中文本输入框并排未对齐

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

我需要2个文本输入框并排在一页使用css3。我已经准备好了一切,除了第二个框在第一个输入框下面。如何在css中更正此问题

html:

<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
}