css - 为什么我的提交按钮位置不正确?

标签 css

我认为这是一个非常简单的 CSS 问题。

我正在玩 Magento 并学习 CSS(糟糕的组合?)。我正在尝试制作一个 2 行登录框。各自字段上方的电子邮件和密码字段标签,以及输入字段右侧的提交按钮。

唉,无论我怎么尝试,提交按钮最终都会出现在其他地方(主要是在第一行)。我已经这样做了四个小时,我从其他网站阅读了更多代码,但仍然无法正常工作!

.block-login {
float:right;
width:530px;
}

.block-login.block-content {
}

.mini-login-input {
float:left;
margin-right:20px;
height:100%
}

.mini-login-input.label {
}

.block-login.button {
}

它来自的 HTML(不是我写的,Magento 代码):

<div class="block-login">

<form action="http://magento.local/customer/account/loginPost/" method="post">
    <div class="block-content">
        <div class="mini-login-input">
            <label for="mini-login">Email:</label><br /><input type="text" name="login[username]" id="mini-login" class="input-text" />
        </div>
        <div class="mini-login-input">
            <label for="mini-password">Password:</label><br /><input type="password" name="login[password]" id="mini-password" class="input-text" />
        </div>

        <div class="actions">
            <button type="submit" class="button"><span><span>Login</span></span></button>
        </div>
    </div>
</form>

如有任何建议,我们将不胜感激。

最佳答案

表格有什么问题?

<table>
    <tr>
       <td>Email box here</td>
       <td rowspan="2" style="vertical-align: middle;">Login button here</td>
    </tr>
    <tr>
       <td>Password box here</td>
    </tr>
</table>

关于css - 为什么我的提交按钮位置不正确?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8454766/

相关文章:

css - 选择类型的第一个 child

html - 如何根据它的宽度使用背景图像制作 div 的高度?

javascript - 使用 jQuery、+= 和 -= 支持设置 css3 转换属性

html - 将页脚元素放置到 div 的底部而不使用边距 - bootstrap

javascript - 下拉菜单不会在第二次单击时关闭

html - CSS 图像按钮样式

javascript - Material-ui主题父组件但不是同类型的子组件

javascript - 在 TreeMap 中将文本元素对齐到中间

css - 如何使用 CSS 在网页背景上拉伸(stretch)标题

html - 使用flex-box时如何添加一行作为伪元素