I'm trying to modify some PHP code (actually, the HTML section inside it) to set the background as transparent, so the displayed text shows the website's template's background beneath the text. It works great in Firefox, Safari and even Chrome, but in IE7 the background is solid white no matter what I do.

I've finally given up on trying to make IE display it the way I want and tried using a conditional statement to set the background to a solid, dark color in IE 7 and above (I don't trust 8 to work, either), but I can't even get that to work! This is really frustrating. How can I make this work so IE7 users can at least see the text?

Here's the URL in question:

and here's the code as I've modified it:

header("Refresh: 30;");

<TITLE>AoN Network Radio Status</TITLE>
<BODY <bgcolor transparency="0">
<!--[if gte IE 7]>
<BODY <bgcolor="1F1F1F">
<TABLE align="center" width="95%">
<TR><TD><font face="Arial" color="FFFFFF" size="3">
Current Song: <b><?php echo $current_song; ?></b><br>
Current Show:  <b><?php echo $server[0]['desc']; ?></b><br>
Listeners: <?php echo $listeners; ?>/<?php echo $max_listeners; ?><br><br></font><TD><TR>

$i = 0;
echo "<table align=\"center\" width=\"60%\">
<td rowspan=\"".sizeof($lastsong)."\" valign=\"top\"><font face=\"Tahoma\" color=\"F2F2F2\" size=\"1\">Previous ".sizeof($lastsong)." Ch00000ns:</font></td>";
while ($lastsong[$i])
	if ($i != 0)
		echo "<tr>";
	echo "<td><font face=\"Tahoma\" color=\"D9D9D9\" size=\"2\">";
	echo $lastsong[$i];
	echo "</font></td></tr>";
echo "</TABLE>";

8 Years
Discussion Span
Last Post by motterj

motter, in your iframe, example2.php,

<BODY <bgcolor="1F1F1F">

should be

<body bgcolor="1F1F1F">

Also, you should validate your code with W3C if you expect to have a cross browser compliant site.


Thanks, and drat! :) That's what happens when you get frustrated, I guess- you miss things like that which make all the difference. It's working now.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.