Is it possible to display a link on TOP of a an image in a table using display:block?

Discussion in 'HTML & Website Design' started by Xexi, May 7, 2007.

  1. #1
    I have a table that is displaying a image. The image is linked to a url and I would like to add other links on top of the linked image heading elsewhere.

    Here is what I have:

    
    <table width="200" height="200" border="1" summary="whee" bordercolor="#000000">
    <TR>
    <TD width="200" height="200" background="blah.jpg" align="center">
    <a href="Hello.htm" style="display: block; height: 100%; ">Text Here</a>
    </TD>
    </TR>
    </table>
    Code (markup):
    The links are dynamic, so image maps will not work.

    Is this possible?
     
    Xexi, May 7, 2007 IP
  2. kkoder2007

    kkoder2007 Peon

    Messages:
    172
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    In your code, image is not linked to url,

    instead, link is inside your table cell, you can easily add more links like this:

    
    <table width="200" height="200" border="1" summary="whee" bordercolor="#000000">
    <TR>
    <TD width="200" height="200" background="blah.jpg" align="center">
    <a href="Hello.htm" style="display: block; height: 100%; ">Text Here</a>
    <a href="Kello.htm" style="display: block; height: 100%; ">New Text Here</a>
    <a href="Pello.htm" style="display: block; height: 100%; ">Few Text Here</a>
    
    </TD>
    </TR>
    </table>
    
    HTML:

    if you intend to add links on top of image, you need to do this way:
    
    <table width="200" height="200" border="1" summary="whee" bordercolor="#000000">
    <TR>
    <td width="200" height="200" align="center">
    <a href="Kello.htm" style="display: block; height: 100%; ">New Text Here</a>
    <a href="Pello.htm" style="display: block; height: 100%; ">Few Text Here</a>
    </td>
    </tr>
    <tr>
    <TD width="200" height="200" background="blah.jpg" align="center">
    <a href="Hello.htm" style="display: block; height: 100%; ">Text Here</a>
    </TD>
    </TR>
    </table>
    
    HTML:

    hope this helps :)
     
    kkoder2007, May 7, 2007 IP
  3. Xexi

    Xexi Well-Known Member

    Messages:
    91
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    100
    #3
    Ahh, good point.


    Well, instead is it possible to add links on top of the full cell link with any scriptiing language?
     
    Xexi, May 7, 2007 IP
  4. dp-user-1

    dp-user-1 Well-Known Member

    Messages:
    794
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    110
    #4
    HTML isn't a scripting language...
     
    dp-user-1, May 29, 2007 IP