Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试获取登录表单的“忘记密码”文本的背景颜色以更改颜色,当用户从密码文本输入字段中选择它时。
我试过了
#login-box a:focus, a:active { background-color: yellow; }
但是当用户点击链接时,链接的背景颜色不会改变。
必须使它成为一种全球风格,不依附于任何.或#
.
#
使用focus和hover
focus
hover
a:hover {background:yellow; color:navy;} a:focus {background:yellow; color:navy;}
这是一个演示http://jsfiddle.net/kevinPHPkevin/s8Rdu/1/