CSS:溢出:滚动;没有出现

时间:2014-05-04 18:56:50

标签: css scroll overflow

编辑:在此答复:Google Chrome Bug - Overflow:auto | scroll doesn't work

我的溢出滚动条没有出现在我的结果page.php中。我已经检查了错误,例如不包括班级的高度,但我无处可去。也许这是搞砸它的PHP?

enter image description here

您可以通过http://biketurtle.co/search.php来自己查看问题 并在'Antrim'中寻找低于1000欧元的自行车

这是CSS类:

.textarea

{
height: 848px;
padding-right: 20px;
padding-left: 20px;
list-style: none;
overflow:scroll;
position:relative;

}

以下是一些HTML:

<section class="section">

<div class="textarea">
<h1>Search</h1>

<?php
if($_SERVER['REQUEST_METHOD']=='POST')
{
include("db_connect.php"); 

$sql = "SELECT brand,model,type,town,location,university,price,cond,description FROM       placead WHERE price < ? AND location = ?";
if($stmt = $link->prepare($sql))
{
$stmt->bind_param('is', $_POST['price'], $_POST['location']);
$stmt->execute();
$stmt- >bind_result($brand,$model,$type,$town,$location,$university,$price,$condition,$description    );


/* store result */
$stmt->store_result(); //required to get num_rows   
echo"==============================================================";
echo "<br/>";
echo "<br/>";
printf("Your search returned : %d records <br/>", $stmt->num_rows);
echo "<br/>";
echo"==============================================================";

/* fetch values */
while ($stmt->fetch()) {
echo "<br />Price.................................".$price." Euro.";
echo "<br />location..............................".$location;
echo "<br />Brand.................................".$brand;
echo "<br />Model.................................".$model;
echo "<br />Type..................................".$type;
echo "<br />Town..................................".$town;
echo "<br />University............................".$university;
echo "<br />Condition.............................".$condition;
echo "<br/>";
echo "<br/>";
echo "<br />                Description           ";
echo "<br/>";
echo "<br/>".$description;
echo "<br/>";
echo"==============================================================";
}   
//close the crecordset
$stmt->close();
}
$link->close();
}
else {
?>
// contd......

1 个答案:

答案 0 :(得分:0)

我没有看到任何错误。我在这里创建了一个带有相同CSS属性的文本框的jsfiddle:http://jsfiddle.net/TD6HX/

#limit_height
{
    width: 200px;
    height:300px;
    overflow: scroll;
    position:relative;
    padding-left:15px;
    padding-right:15px;
}