IMG element as background

Discussion in 'HTML & Website Design' started by queen_mary, Nov 9, 2009.

  1. #1
    I have an object which can be called only inside an IMG tag (<img src="location of object">).

    How can I put this element as a background for a table ?
     
    queen_mary, Nov 9, 2009 IP
  2. AfroSamurai

    AfroSamurai Peon

    Messages:
    64
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I'm not sure what you mean man, can you expain a bit more ?
    to add a backgrpound to a table , you could use this , <TABLE CELLPADDING=8 CELLSPACING=0 BACKGROUND="location of image">
    but I guess you already knew that
     
    AfroSamurai, Nov 9, 2009 IP
  3. queen_mary

    queen_mary Peon

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I'm using static google map as background which is tobe embedded in img tag (with API key).

    i wish to know how to do this?
     
    queen_mary, Nov 9, 2009 IP
  4. n3r0x

    n3r0x Well-Known Member

    Messages:
    257
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    120
    #4
    i used <img style="z-index: -1; width: ; height: ;" src=""> to fix the problem i had with a similar thing..
     
    n3r0x, Nov 9, 2009 IP
  5. queen_mary

    queen_mary Peon

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks n3r0x

    But how do you put that as a background for a table element? Pl help
     
    queen_mary, Nov 9, 2009 IP
  6. n3r0x

    n3r0x Well-Known Member

    Messages:
    257
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    120
    #6
    z-index: -1 will put it 1px behind the table.. and should therefor be seen as a background image.. :)
     
    n3r0x, Nov 9, 2009 IP
  7. queen_mary

    queen_mary Peon

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Sorry for asking again.

    the element for table will be

    <table id="mytable" background"">


    Can I put <img style="z-index: -1; width: ; height: ;" src=""> as

    <table id="mytable" background"<img style="z-index: -1; width: ; height: ;" src="">">

    I'm a beginner :(
     
    queen_mary, Nov 9, 2009 IP
  8. n3r0x

    n3r0x Well-Known Member

    Messages:
    257
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    120
    #8
    
    <table width="400" height="400" valign="top" border="1" cellspacing="0px">
      <tr height="50"><td>Title</td></tr>
      <tr height="350"><td>Some more text</td></tr>
      
      </table>
      <img src="error.jpg" style="position: relative; top: -400px; ;z-index: -1;height: 400px; width: 400px;">
    
    PHP:
    This is just so you´ll get an idea on how to do it. You´ll have to edit it to suit your needs.. :)
     
    n3r0x, Nov 9, 2009 IP
  9. queen_mary

    queen_mary Peon

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Thanks.

    BTW, is there any way we could avoid the empty space created after placing this element? (my table is placed inside another table) ?
     
    queen_mary, Nov 9, 2009 IP
  10. queen_mary

    queen_mary Peon

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Any ideas to avoid the empty space created ?

    Thanks
     
    queen_mary, Nov 12, 2009 IP