Old 16-09-2005, 12:06   #1 (permalink)
jvbates
Registered User
 
Join Date: Nov 2004
Posts: 16
IE6 background-image weirdness

Guys,

I'm having a problem with a background-image being applied to a header div in IE6! The DIV has an ID of masthead, and a unique class applied to it depending on which section the page sits in...

THE XHTML
----------------------------------------------
<div id="masthead" class="mast-au"><a href="index.php" title="Workplace Giving homepage"><img id="logo" src="img/global/wpg_logo.gif" alt="Workplace Giving logo" width="223" height="90" /></a></div>


THE CSS
----------------------------------------------
.mast-ho#masthead { background: #fff url(../img/masts/mast_ho.jpg) no-repeat 0% 0%; }

/*THIS IS THE ONE THAT SHOULD BE APPLIED*/
.mast-au#masthead { background: #fff url(../img/masts/mast_au.jpg) no-repeat 0% 0%; }

.mast-pg#masthead { background: #fff url(../img/masts/mast_pg.jpg) no-repeat 0% 0%; }

.mast-ei#masthead { background: #fff url(../img/masts/mast_ei.jpg) no-repeat 0% 0%; }

.mast-fa#masthead { background: #fff url(../img/masts/mast_fa.jpg) no-repeat 0% 0%; }

.mast-ne#masthead { background: #fff url(../img/masts/mast_ne.jpg) no-repeat 0% 0%; }

.mast-cu#masthead { background: #fff url(../img/masts/mast_cu.jpg) no-repeat 0% 0%; }

The problem is, that IE6 doesn't apply the background-image, every other browser on Mac & PC get it OK!! I can't understand it - anyone got any ideas?

Jay
  Reply With Quote
Old 16-09-2005, 14:29   #2 (permalink)
pgo
Senior Member
 
Join Date: Jan 2005
Posts: 12,340
This doesn't make sense to me - .mast-au#masthead - why not just give each page's masthead a different class and forget the ID??

Try removing the IDs...see if that does anything...
  Reply With Quote
Old 19-09-2005, 06:45   #3 (permalink)
Dusteh
Sir digby chicken caesar
 
Dusteh's Avatar
 
Join Date: Sep 2004
Posts: 5,265
I'm guessing IE is being confused by the ID tag within the HTML. ID always overrides a class, but it might not be able to see the ID within your CSS because its nested after the class titles. Not sure why it wouldn't then read the class tag - but I guess its another IE bug.

Either way pgo is correct, there is no need for the ID tag at all?
  Reply With Quote
Old 19-09-2005, 09:16   #4 (permalink)
stickmus
hmmm...
 
stickmus's Avatar
 
Join Date: Jan 2004
Location: Yorkuk
Posts: 2,127
Someone else had a similar problem a while back, think they ended up putting an id on the body in the end.
  Reply With Quote
Old 19-09-2005, 09:33   #5 (permalink)
emil
dt immigrant
 
emil's Avatar
 
Join Date: Nov 2004
Location: Bucharest - Romania
Posts: 7,447
Send a message via ICQ to emil Send a message via MSN to emil Send a message via Yahoo to emil Send a message via Skype™ to emil
link?

try the other way around
#masthead.whateverClass {blah}
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8