Test page:
<!DOCTYPE html>
<html>
<head>
<title>button border hover test</title>
<style type="text/css">
input
{
border: 0;
padding: 0;
}
input:hover
{
background-color: fuchsia;
}
</style>
</head>
<body>
<form>
<input type="button" value="input element" /><br>
</form>
</body>
</html>
The background colour does not change. If you set the padding to anything higher than 0, the background colour does change.
I’m not seeing this behaviour in Firefox.
Having a padding of 1px isn’t disruptive to the layout, but does anyone know of a way to make this work with 0 padding?
There are two possible solutions.
<button>element instead.Some relevant information from http://www.sitepoint.com/forums/showthread.php?769898-button-vs.-input-type-quot-button-quot