请问对吗?

来源:3-12 编程练习

qq_慕先生3429672

2020-04-29 17:16:56

<!DOCTYPE html>

<html>

<head>

    <meta charset="UTF-8">

    <title>可设置宽和高的元素</title>

    <style type="text/css">

       div{ width:600px;height:200px;border:1px solid gray;font-size:14px;}

       /*补充样式*/

       p{width:30%;font-size:2em}

       span{width:30%;height:25%;}

       .input{width:100px;height:30px;background-color:orange;font-size:20px;}

       

       

    </style>

</head>

<body>

    <div>

        <p>登录</p>

        <span>请输入您的信息:</span><input type="text" class="input"><br>

        <input type="submit" class="sub">

    </div>

</body>

</html>


写回答

3回答

好帮手慕码

2020-05-05

同学你好,代码中问题如下,多余的符号:

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

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

其他效果正确。另,因为span是行内块元素,所以设置宽高是不生效的。

祝学习愉快~

0

好帮手慕码

2020-04-29

同学你好,“qq_慕无忌5353450”的提示是正确的,更加符合编程要求:

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

祝学习愉快~

0
hq_慕先生3429672
h <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title>可设置宽和高的元素</title> <style type="text/css"> /div{ width:600px;height:200px;border:1px solid gray;font-size:14px;} /*补充样式*/ p{width:30%;font-size:2em} .input{width:30%;height:25%;} .sub{width:100px;height:30px;background-color:orange;font-size:20px;} span{width:600px;height:200px;}/*没变化啊*/ </style> </head> <body> <div> <p>登录</p> <span>请输入您的信息:</span><input type="text" class="input"><br> <input type="submit" class="sub"> </div> </body> </html>
h020-05-04
共1条回复

qq_慕无忌5353450

2020-04-29

<!DOCTYPE html>

<html>

<head>

    <meta charset="UTF-8">

    <title>可设置宽和高的元素</title>

    <style type="text/css">

       div{ width:600px;height:200px;border:1px solid gray;font-size:14px;}

       /*补充样式*/

       

       p{width:30%;font-size:2em;}

       .input{width:30%;height:25%;}

       .sub{width:100px;height:30px;background-color:orange;font-size:20px;}

       span{width:600px;}

    </style>

</head>

<body>

    <div>

        <p>登录</p>

        <span>请输入您的信息:</span><input type="text" class="input"><br>

        <input type="submit" class="sub">

    </div>

</body>

</html>

不一定对,仅供参考。是给提交按钮设置颜色吧。

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

0

0 学习 · 40143 问题

查看课程

相似问题

请问对吗?

回答 1

请问对吗?

回答 1

请问对吗?

回答 2

请问对吗?

回答 1

请问对吗?

回答 1