表td中的Href没有打开链接

时间:2018-09-04 00:42:01

标签: 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>";

3 个答案:

答案 0 :(得分:1)

对于是否可以在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>";

答案 1 :(得分:0)

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>";

答案 2 :(得分:0)

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