所以我想让这段“你用PC工作的小时数”在标签下面和标签之间对齐,并输入type=text of studentnumber:and games:
正如你所看到的,它的位置很不合适,我该如何修复它呢?
null
.container {
background-color: rgb(157, 230, 255);
height: 600px;
}
.container input {
display: inline-block;
float: left;
margin: 20px;
}
.container label {
display: inline-block;
float: left;
clear: left;
width: 250px;
margin: 20px;
}
form {
text-align: left;
}
<div class="container">
<form>
<div style="line-height: 400%;">
<br>
</div>
<label for="studentnumber">Studentnumber:</label>
<input type="text">
<br>
<p>Numbers of hours you work with pc with</p>
<br>
<label for="games">Games:</label>
<input type="text">
<br>
<label for="sosial media">Sosial media:</label>
<input type="text">
<br>
<label for="skole">School:</label>
<input type="text">
</form>
</div>
null
由于/code>和
/code>元素是浮动的
因此,在元素上应用