什么导致与提交按钮和按钮不对齐

时间:2011-01-01 06:20:31

标签: html css

我喜欢HTML ...

<input type="submit" name="submit" id="submit" value="Login">
<button name="forgotPassword" id="forgotPassword" type="button" class="linkButton">Forgot Password</button>

CSS看起来像

input[type=button], input[type=submit], button {
  border: none;
  background: $mainColor;
  color: #fff;
  padding: 5px 10px;
  cursor: pointer;
}
input[type=button]:hover, input[type=button]:active,
input[type=submit]:hover, input[type=submit]:active,
button:hover, button:active {
  background: $hoverColor;
}

但我的按钮似乎未对齐...忘记密码高一点......我该如何解决这个问题(垂直对齐)?

2 个答案:

答案 0 :(得分:3)

如何使用<input type="button">代替<button>

答案 1 :(得分:0)

您可以在IE中将登录按钮的高度更改为更高一点。但是在firefox中对齐好了。

input[type=button], input[type=submit], button {
  border: none;
  background: $mainColor;
  color: #fff;
  padding: 5px 10px;
  cursor: pointer;

}
input[type=button]:hover, input[type=button]:active,
input[type=submit]:hover, input[type=submit]:active,
button:hover, button:active {
  background: $hoverColor;
  height:50px;
}