View Full Version : IE not reading background-image: url ()

05-07-2006, 09:44 AM
I'm in the middle of making a template went to check it and noticed i get a blank page in IE but FF reads it correctly (go figure). Would love to know if there is a CSS fix for this. live page (http://designbydefault.com/templates/Levitt/)

Body {background-color: #FFFFFF}
.-Banner {background-image: url(images/banner.jpg)}
.-MainBackground {background-image: url(images/background.jpg)}
.-LowerBackground {background-image: url(images/bottom.jpg)}

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<title>Lulevitt Financial Realty Developments</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="lulevitt.css" rel="stylesheet" type="text/css" />

<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div align="center">
<table width="900" height="620" border="0" cellpadding="0" cellspacing="0" class="-MainBackground">
<td height="80" colspan="2" class="-Banner">&nbsp;</td>
<td width="80" height="600" valign="top">&nbsp;</td>
<td width="836" valign="top">&nbsp;</td>
<td height="20" colspan="2" class="-LowerBackground">&nbsp;</td>

05-07-2006, 10:42 AM
Is there a good reason why your class-names start with a hyphen? Wouldn't surprise me if that was the issue...

05-07-2006, 10:45 AM
no not really just wanted them on the top of my css list in DW

05-07-2006, 11:46 AM
Try removing the hyphens. Browsers behave differently when you use anything other than the 36 alphanumeric characters to name or reference classes. Also, remove the XML prolog; it throws Internet Explorer into quirks mode and isn't necessary. The xmlns attribute isn't necessary either.

If you really have an issue with CSS markup formatting, edit it manually. The editor should respect your changes... At least Adobe GoLive CS2 does for me.