如何用css更改tab键选择颜色?

时间:2016-06-03 12:11:47

标签: css css3

当我按Tab键并选择一个按钮时,它会出现边框。是否可以使用css更改其颜色或完全删除边框?

1 个答案:

答案 0 :(得分:3)

<!DOCTYPE html>
<html>
<head>
<style>
input:focus {
    background-color: yellow;
}
</style>
</head>
<body>

<p>Click inside the text fields to see a yellow background:</p>

<form>
First name: <input type="text" name="firstname"><br>
Last name: <input type="text" name="lastname">
</form>

<p><b>Note:</b> For :focus to work in IE8, a DOCTYPE must be declared.</p>

</body>
</html>