Jump to content

problem with hyperlink


MDanz

Recommended Posts

<a href='http://www.u-stack.com/display.php?id=$id' style='text-decoration: none'><tr><td width='330px' height='103px' background='$image' VALIGN='middle' style='border: 1px solid #99731E;'>
                                <font color='#FF6600' size='6' face='Arial'><center><strong>$newname\n</strong></center></font><br></td></tr></a>

 

i don't see why this isn't working

 

heres my website.. an example.. when i put mouse over any of the results, no hyperlink?

 

http://www.u-stack.com/ustack.php?search=MDanz&submit=Go!

Link to comment
Share on other sites

This is NOT a PHP issue, this is basic HTML. The fact that you are using PHP to create the hyperlink is irrelevant to the issue.

 

[Moved post to HTML forum]

 

You cannot put a hyperlink around a table element. It seems to work in IE (except the hand icon doesn't appear on mouseover), but IE tends to be very forgiving of coding errors. By your use of FONT tags (which have been deprecated for years) I think you need a refresher on HTML coding.

 

Assuming you are using PHP to echo the hyperlink, try this:

 

echo "<tr>\n";
echo "<td width=\"330px\" height=\"103px\" background=\"{$image}\" valign=\"middle\"";
echo " style=\"border:1px solid #99731E;color:#FF6600;font-family:Arial, Sans-serif;font-size:16pt;font-weight:bold;text-align:center;\">\n";
echo "<a href=\"http://www.u-stack.com/display.php?id={$id}\" style=\"text-decoration: none\">{$newname}</a>\n";
echo "</td>\n";
echo "</tr>\n";

 

Or, better yet, create a class for the td style properties.

Link to comment
Share on other sites

You can not nest block elements.  Think about it like reading a book, you don't put a paragraph inside another paragraph.  You put sentences inside a paragraph, sentences representing inline elements.

 

With that... table is block, a is inline.  So

<table>
<tr>
<td><a href="">text</a></td>
</tr>
</table>

 

You may want to move your styles into CSS either external or internal, whatever your preferece.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.