最大高度/行和设置滚动

时间:2015-09-23 12:26:41

标签: javascript jquery html css

我的桌面在我的html php文件里面我想要它设置最大高度,如果它达到最大值并想要添加更多它将是可滚动的,这怎么可能?这是我的项目谢谢

我希望在达到500px后可以滚动



<div class="container" style="max-height: 500px;width:600px;height:500px border:1px solid black">
<div class="panel panel-default" style= "max-height: 500px;">
    <div class="panel-heading" align="center">
        <img src="or.png" alt="or" style="width:200px;height:40px;">
    </div>
    <div class="panel-body" style= "max-height: 500px;">         
  <table class="table">

  <tr>

<th><FONT color="CB7F16">Foodname</FONT></th>
<th><FONT color="CB7F16">Quantity</FONT></th>

<tr>

<?php

while($food=mysql_fetch_assoc($list)) {

  echo"<tr>";
  
  echo"<td><FONT color='FA9404'>".$food['food']."</FONT></td>";
  echo"<td><FONT color='FA9404'>".$food['quantity']."</FONT></td>";
  
  echo"</tr>";
  
}

?>
  <tr>
    <td colspan="2" align="center"><a class="btn" href="acceptorder.php">Accept</a></td>
  </tr>
  
  </table>
  </div> 
  </div>
  </div>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:2)

overflow-y:auto;添加到相应的div。

相关问题