Link to home
Start Free TrialLog in
Avatar of rtho7
rtho7

asked on

Cross Browser Problem With Background Image

Why will a backround="" work in a table in IE and not in Netscape... or will it? The image becomes jumbled
and unrecognizable.

<table background="images/back.jpg" border="0" cellpadding="0" cellspacing="0">
ASKER CERTIFIED SOLUTION
Avatar of dij8
dij8
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of webdude
webdude

actually, you dont need to nest your tables to solve this one....

In NS, the background IS placed in every cell, as we call it "TILED"....

the quick, easy fix, (which took me years to finally figure out), is to simply create a transparent image, just 1 x 1 pixels, lets call it spacer.gif.

then you need to set the background="spacer.gif" in the IMMEDIATE following tag that accepts background attribute, whether it is a <table> or <td>

this should fix ur prob...

cheers!~
yet another way to do it is to put the table in a div and set the background of the div
<div background="bkgd.gif">
<table border="0" cellpadding="0" cellspacing="0">
     <tr>
       <td>Your table stuff.</td>
       <td>Your table stuff.</td>
     </tr>
     <tr>
       <td>Your table stuff.</td>
       <td>Your table stuff.</td>
     </tr>
</table>
</div>
A variation on the nested table is to apply the background at cell level and nets the table there:

<table border="0" cellpadding="0" cellspacing="0">
 <tr>
   <td background="yourimage.jpg">
      <table border="0" cellpadding="0" cellspacing="0">
  <!-- whataever stuff is in the table now -->
      </table>
   </td>
 </tr>
</table>

Cd&
in netscape that will tile cobol, as i mentioned previously. you HAVE to put transparent .gif in IMMEDIATE cell AFTER you use a background image.

:)
couldn't the background be applied at cell level <td> only instead of the whole table? That way, nesting tables wouldn't need to be used. It worked for me on my pages at http://www.geocities.com/cuuld/free-tech/listings/browsers.htm

Also, does using the background image/url CSS property help with the netscape problem?

Last, this question seems more appropriate for HTML category instead of CSS.
rtho7,

How are we doing with this?

Cd&
rtho7,

The next time you are on the planet, could you drop by and let us know what you are going to do with this?

Cd&
It is time to clean this abandoned question up.  

I am putting it on a clean up list for CS.

<recommendation>
points to dij8

</recommendation>

If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.

Cd&
Comment from dij8 accepted as answer.

Thank you
Computer101
Community Support Moderator