我设计了一个网站。如您所见,learnmore 图像并没有出现在幻灯片图像之上。
你有以下php代码
<?php
$directory = 'uploads';
$learnmore_img_path='learnmore';
echo'<div style="position: relative; ">';
try {
// Styling for images
echo "<div id=\"myslides\" style='position: relative; z-index:99999;'>";
foreach ( new DirectoryIterator("../" . $directory) as $item ) {
if ($item->isFile()) {
$path = "/" . $directory . "/" . $item;
echo "<img src=\"" . $path . "\" width=861 height=443 href='#' style='position: relative;'/>";
$learnmore_img_path='learnmore';
$path1="/" . $learnmore_img_path . "/" . 'learnmore.jpg';
}
}
echo "</div>";
$path1="/" . $learnmore_img_path . "/" . 'learnmore.jpg';
echo '<a href="#" id="examplelink">';
echo "<img src=\"" . $path1 . "\" width=160 height=30 style='z-index:32111;; p osition: absolute; top: -75; left: 370;'/>";
echo '</a>';
echo "</div >";
}
catch(Exception $e) {
echo 'No images found for this player.<br />';
}
?>
我不知道为什么?是因为z-index吗?任何帮助表示赞赏..