bg images not appearing

Discussion in 'CSS' started by Allied77, Apr 18, 2008.

  1. #1
    Some of the bg images on my page aren't showing. They are there in Dreamweaver but not when I preview? any help?

    Just one example:

    <td width="385"><img src="images/logo.jpg" width="385" height="167"></td>
        <td width="429" background="images/top_right.jpg">&nbsp;</td>
      </tr>
      <[B]tr background="images/mid_bg.jpg">
        <td height="32" colspan="2"></td>[/B]
      </tr>
    Code (markup):
    The top two ar there but the last one in bold is appearing.

    can't figure it out.

    anyone?
     
    Allied77, Apr 18, 2008 IP
  2. homemadejam

    homemadejam Well-Known Member

    Messages:
    143
    Likes Received:
    2
    Best Answers:
    1
    Trophy Points:
    145
    #2
    CSS Code:
    
    .trbackground {
    background: url("blah.jpg")
                       }
    
    Code (markup):
    HTML CODE:
    
    <tr class="trbackground">
     <td height="32" colspan="2"></td>
    
    Code (markup):
    I'm not sure if this is the best way or not, but its the way I'd chose.

    Jam
     
    homemadejam, Apr 18, 2008 IP
  3. qurve

    qurve Peon

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Definitely use CSS to set your background images and not the background attribute (which is no longer valid)

    Also remember when using css to set background images that the path is relative to the CSS file, not the HTML file.
     
    qurve, Apr 21, 2008 IP