Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 设置div框的限制大小_Html_Css - Fatal编程技术网

Html 设置div框的限制大小

Html 设置div框的限制大小,html,css,Html,Css,所以我有一个包含数据库中一些值的框,当我添加更多值时,它们会从框中出来。有没有办法解决这个问题 <div class="check"> <?php $result = mysqli_query($conn, "SELECT * FROM `material` WHERE id > 0"); while($row = mysqli_fetch_assoc($result)):?> <input type="checkbox

所以我有一个包含数据库中一些值的框,当我添加更多值时,它们会从框中出来。有没有办法解决这个问题

<div class="check">
   <?php
     $result = mysqli_query($conn, "SELECT * FROM `material` WHERE id > 0");
     while($row = mysqli_fetch_assoc($result)):?>
       <input type="checkbox" value="<?php echo $row['id'];?>" name="tipo[]" 
       id="tipo"><label><?php echo $row['tipo'];?></label><br>
       <input type="number" name="quant[]" min="1" max="50" id="textnumber" 
       class="number" disabled="true" style="margin-left: 145px; margin-top: 
       -36px; width: 40px; position: absolute;">
   <?php endwhile?>
</div>



在这段代码中有一些奇怪的东西(即,我不认为需要输入上的
位置:绝对的
),但只需关注您的问题:

我猜您在某处使用了一些CSS来设置
check
div的高度

添加一个
溢出:隐藏
,以隐藏任何不适合该框的内容:

。检查{
高度:100px;
溢出:隐藏;
}
或者使用
overflow:auto
使其在内容不适合时可滚动:

。检查{
高度:100px;
溢出:自动;
}