提问者:小点点

为什么这一行段落没有与其他段落保持一致[重复]


所以我想让这段“你用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


共1个答案

匿名用户

由于/code>和/code>元素是浮动的,您需要取消文本的浮动效果。

因此,在元素上应用(或仅)将强制它换行到新行。