3-12 練習老師請檢查
来源:3-12 编程练习
慕数据3203843
2019-08-15 16:15:06
<!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-family:2em;}
.input{width:30%;height:20%;}
.sub{width:100px;height:30px;background-color:orange;font-size:20px;}
span{width:400px;height:200px;}
</style>
</head>
<body>
<div>
<p>登录</p>
<span>请输入您的信息:</span><input type="text" class="input"><br>
<input type="submit" class="sub">
</div>
</body>
</html>老師!加入span標簽沒有出現明顯效果?!
1回答
同学你好, 因为span标签是行内元素, 设置宽高不会生效, 这里主要就是为了让同学观察效果的哦
另, 代码中还存在如下问题
段落需要通过font-size属性设置字体大小是父元素的两倍, input高度设置为25%才父元素高度的四分之一。 建议修改:

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