老师,感觉红色边框里面还有一种颜色挡住了,能帮我看下吗谢谢
来源:2-17 编程练习
xchengguang
2019-09-01 15:13:32
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>动态伪类</title>
<style type="text/css">
/*此处写代码*/
.usrname:hover{
border-color: red;
}
.usrname:focus{
background-color: orange;
}
.pwd:hover{
border-color: red;
}
.pwd:focus{
background-color: yellow;
}
</style>
</head>
<body>
<!-- 此处写代码 -->
<form action="">
用户名: <input type="text" class="usrname">
<br>
密码: <input type="password" class="pwd">
</form>
</body>
</html>1回答
同学你好,首先是对的, 感觉红色框别挡住了是因为浏览器默认为input聚焦的时候添加outline属性,建议修改:可以清除默认的样式


如果帮助到了你, 欢迎采纳!
祝学习愉快~~~
相似问题
回答 2
回答 1