Jiew Meng
Jiew Meng

Reputation: 88197

Whats causing misalignment with submit button and button

I have HTML like ...

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

CSS looks like

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

But my buttons seem misaligned ... forgot password is alittle higher ... How can I fix this (align them vertically)?

Upvotes: 0

Views: 727

Answers (2)

tkt986
tkt986

Reputation: 1028

You can change the height attribut of the login button a bit highter in IE. But aligned okey in forfox.

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

Upvotes: 0

mauris
mauris

Reputation: 43619

How about using <input type="button"> instead of <button>?

Upvotes: 3

Related Questions