表 td 中的 Href 不会打开链接

  • 本文关键字:链接 td 中的 Href html css
  • 更新时间 :
  • 英文 :


我试图让 href 在 IE 11 的表 tr 中工作。似乎其他示例正在工作,但我的表格样式似乎不如原始样式显示良好。不工作的意思是当我点击桌子时什么也没发生。下面是我的代码

echo "<div id='front_end_menu_id' style='width:auto;border:0px solid #000000;'>";
echo "<table cellpadding=0 border=0>";
echo "<tr>";
echo "<a href='http://test.php'><td>";  
echo "<td align=left style='cursor:pointer;background:#111111;height:35px;width:470px;' valign=top>";   
echo "<table cellpadding=2  border=0 style='height:38px;border:0px solid #888888;width:470px;'  >";
echo "<td align=center width=60><img src=images/aa.png width=50></td>";
echo "<td><font color=#ffffff size=3 face='century gothic'>TESTING</font><br><font color=#999999 style='font-size:10px;'>Description</td>";
echo "</table>";
echo "</td>";
echo "</td></a></tr>";
echo "</table>";
echo "</div>";

我不太确定是否可以在TD标签周围放置锚标签。更糟糕的是,在您关闭第一个TD标签之前,您似乎有第二个未打开的TD标签。试试这个,在TD内放置锚点:

echo "<div id='front_end_menu_id' style='width:auto;border:0px solid #000000;'>";
echo "<table cellpadding='0' border='0'>";
echo "<tr>";
echo "<td align='left' style='cursor:pointer;background:#111111;height:35px;width:470px;' valign='top'>";
echo "<a href='http://test.php'>";
echo "<table cellpadding='2'  border='0' style='height:38px;border:0px solid #888888;width:470px;'  >";
echo "<td align='center' width='60'><!-- <img src='images/aa.png' width='50'>--></td>";
echo "<td><font color='#ffffff' size='3' face='century gothic'>TESTING</font><br><font color='#999999' style='font-size:10px;'>Description</td>";
echo "</table>";
echo "</a>";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "</div>";
echo "<div id='front_end_menu_id' style='width:auto;border:0px solid #000000;'>";
echo "<table cellpadding=0 border=0>";
echo "<tr>";
echo "<td>";    
echo "<td align=left style='cursor:pointer;background:#111111;height:35px;width:470px;' valign=top>";   
echo "<table cellpadding=2  border=0 style='height:38px;border:0px solid #888888;width:470px;'  >";
echo "<a href='http://test.php'>";
echo "<td align=center width=60><img src=images/aa.png width=50></td>";
echo "<td><font color=#ffffff size=3 face='century gothic'>TESTING</font><br><font color=#999999 style='font-size:10px;'>Description</td>";
echo "</a></table>";
echo "</td>";
echo "</td></tr>";
echo "</table>";
echo "</div>";

<td><a href="https://www.google.com/" target="_blank"> Hello</a></td>

最新更新