1

我有下表显示在 IE 中呈现不佳但在 Mozilla Firefox 中显示良好的图片库。

问题是图像库一直水平滚动超出边界,而不是拆分到下一行。

这是代码:

<?php

include("includes/config_gallery.php");

    $sql = "SELECT * FROM ".$SETTINGS["data_table"]." GROUP BY cobjecttype ORDER BY cobjecttype";
    $sql_result = mysql_query ($sql, $connection ) or die ('request "Could not execute SQL query" '.$sql);
    while ($row = mysql_fetch_assoc($sql_result)) {
        echo "<option value='".$row["cobjecttype"]."'".($row["cobjecttype"]==$_REQUEST["cobjecttype"] ? " selected" : "").">".$row["cobjecttype"]."</option>";
    }


 $count = 0;

if ($_REQUEST["string"]<>'') {
    $search_string = " AND (ctitle LIKE '%".mysql_real_escape_string($_REQUEST["string"])."%' OR csubject LIKE '%".mysql_real_escape_string($_REQUEST["string"])."%')"; 
}

if ($_REQUEST["ref"]<>'') {
    $search_string = " AND (creference LIKE '%".mysql_real_escape_string($_REQUEST["ref"])."%')";
}

if ($_REQUEST["cobjecttype"]<>'') {
    $search_cobjecttype = " AND cobjecttype='".mysql_real_escape_string($_REQUEST["cobjecttype"])."'";  
}
if ($_REQUEST["cartist"]<>'') {
    $search_string = " AND (cartist LIKE '%".mysql_real_escape_string($_REQUEST["cartist"])."%')";
}

if ($_REQUEST["cyear"]<>'') {
    $sql = "SELECT * FROM ".$SETTINGS["data_table"]." WHERE cyear = '".mysql_real_escape_string($_REQUEST["cyear"])."'".$search_string.$search_cobjecttype;
}
else {
    $sql = "SELECT * FROM ".$SETTINGS["data_table"]." WHERE c_id>0".$search_string.$search_cobjecttype;
}

$sql_result = mysql_query ($sql, $connection ) or die ('request "Could not execute SQL query" '.$sql);
if (mysql_num_rows($sql_result)>0) {
    while ($row = mysql_fetch_assoc($sql_result)) {
    $c_id=$row['c_id'];
?>
    <td valign=top> 

    <table width=150 border=0 align=left class=allborder> 
    <tr> 
    <td width=70 bgcolor=#eee><a href="details.php?c_id=<?php echo $c_id; ?>" > <?php echo $row['ctitle']; ?> </a></td>
    </tr>
    <tr> 
        <td><a href=details.php?c_id=<?php echo $c_id ?> ><img src="./images/<?php echo $row['cfilename']; ?>" width="90" height="120" alt="" /></a>
        </td> 
    </tr> 

    </table>

 <?php $count++; 
  if ($count %8 == 0 && $count < $num) {
?>
 <tr>
 <?php } ?>
 </tr>
 </td>


<?php
    }
} else {
?>
<font color=red>No results found.</font>
<?php   
}
?>

请帮忙。

约瑟夫

4

1 回答 1

0

我建议使用 IE 特定的 CSS 来为照片库所在的区域提供最大宽度。

IE6 css specific

* html ‪#‎div‬ { 
height: 300px;
}

IE7 css specific

*+html #div { 
height: 300px;
}

IE7&8 css specific (also seems to work in 10, haven't tested it in 9

#div {
height: 300px\9;
}
于 2013-07-18T21:11:04.180 回答