老师,感觉红色边框里面还有一种颜色挡住了,能帮我看下吗谢谢

来源: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回答

好帮手慕慕子

2019-09-01

同学你好,首先是对的, 感觉红色框别挡住了是因为浏览器默认为input聚焦的时候添加outline属性,建议修改:可以清除默认的样式

http://img.mukewang.com/climg/5d6b82a20001175803350112.jpg

http://img.mukewang.com/climg/5d6b82b20001f42003150086.jpg

如果帮助到了你, 欢迎采纳!

祝学习愉快~~~

0

0 学习 · 40143 问题

查看课程