请问老师属性值加不加双引号有什么区别呢?试了一下好像效果一样

来源:2-17 编程练习

南方记忆

2019-06-10 10:51:07

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>动态伪类</title>
        <style type="text/css">
            input:hover{
                border:1px solid red;
            }
            input[type="text"]:focus{
                background: orange;
            }
            input[type=password]:focus{
                background: yellow;
            }
            /*此处写代码*/
        </style>
    </head>
    <body>
        用户名:<input  type="text" name=""><br/>
        密码:<input type="password" name="">
        <!-- 此处写代码 -->
    </body>
</html>


写回答

1回答

好帮手慕星星

2019-06-10

你好,实现效果没有问题,很棒哦!

属性选择器加不加引号一般都可以选中元素的,能够实现效果就可以。

祝学习愉快!

0

0 学习 · 40143 问题

查看课程