【发布时间】:2011-07-08 00:41:48
【问题描述】:
测试页面:
<!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>
背景颜色不变。如果将填充设置为高于 0 的值,则背景颜色会发生变化。 我在 Firefox 中没有看到这种行为。
1px 的内边距不会破坏布局,但有谁知道使用 0 内边距使这项工作的方法?
【问题讨论】:
-
您可以使用
<button type="submit">元素吗?它将在 IE8 中运行。 labs.findsubstance.com/2009/05/21/… -
不幸的是,该项目建立在一个不允许
-
非常肯定:IE8 仅支持
:hover上的<a>元素。
标签: button internet-explorer-8 input hover