有一个不显示,为什么呢?

来源:2-17 编程练习

weixin_慕田峪7033080

2020-06-30 15:44:10

<!DOCTYPE html>

<html>

    <head>

        <meta charset="UTF-8">

        <title>动态伪类</title>

        <style type="text/css">

            /*此处写代码*/

              input:hover{border-color: #f00;}

            input[type="text"]:focus{background: orange;}

            input[type="password"]:focus{background: #ff0;}

        </style>

    </head>

    <body>

        <!-- 此处写代码 -->

        <form>

            用户名:<input type="text" name="text>

            密码: <input type="password" name="password">

        </form>

    </body>

</html>


写回答

1回答

好帮手慕久久

2020-06-30

同学你好,由于第一个input框的name属性值,缺少闭合的引号,导致第二个input结构没有显示,可做如下修改:

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

优化建议:

input的默认边框,不太好看,如下:


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

建议给input设置个默认边框,如下:

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

如果我的回答帮到了你,欢迎采纳,祝学习愉快!

0

0 学习 · 40143 问题

查看课程