<td width="209" height="94"><a href="../pages/suppliers.php"><img id="img1" src="../images/Suppliers.png" alt="supplier" width="89" height="90" align="middle"/></a></td>
<td id="tdHome" height="66">
<p id="p1"><a href="suppliers.php">New Supplier</a></p>
<p>Enter a new supplier to buy from</p></td>
#p1 {
display: none;
}
#img1:hover + #p1 {
display: block!important;
}
任何人都可以帮助我找到停留在图像上时停止显示段落的问题。
代码已更改为img和p标签具有相同的父级。
<td width="209" rowspan="3"><p><a href="../pages/suppliers.php"><img id="img1" src="../images/Suppliers.png" alt="supplier" width="89" height="90" align="middle"/></a>
</p>
<p> </p>
<p id="p1"><a href="suppliers.php">New Supplier</a></p>
<p>Enter a new supplier to buy from</p>
<p><a href="suppliers.php">Supplier List</a></p>
<p>View/update or delete suppliers</p></td>