views:

31

answers:

1

Don't know how to fix it. I've trying to make different logotypes, depending on class of the tag. The html is:

<div id="header"> 
    <a href="/index.php" id="logo" class="cet"> 
        <h1 id="l">title</h1> 
    </a>
</div>

And css is:

#header {
    height:204px;
    background: url(../img/il-01.jpg) no-repeat  400px 2em;
    position:relative;
    clear:both;
}
#header #logo {
    display:block;
    position:absolute;
    left:2em;
    top:3em;
    width:355px;
    height:107px;
    overflow:hidden;
}
#header #logo.cat { background: url( ../img/logo_cat.png) no-repeat -1px top; }
#header #logo.cet {background: url( ../img/logo_cet.png) no-repeat -10px -40px;}

And if the class is set for 'cat' everything is just fine, but if it's set for 'cet' i can not see the image in IE6. In any other browser the background displays correctly.

The background images are little different by size, can it be the problem?

Thank you very much for your answers

+4  A: 

You are not allowed mix lengths and keywords for the background(-positon). Old CSS versions didn't allow it, so older browsers may not support it. Instead of

#header #logo.cat { background: url( ../img/logo_cat.png) no-repeat -1px top; }

use

#header #logo.cat { background: url( ../img/logo_cat.png) no-repeat -1px 0; }

BTW, You need to check your HTML. A block element such as <h1> may not be inside a link (<a>).

RoToRa
but if i use mixed lengths and keywords, like in 'cat' it works in IE6! but 'cet' doesn't work.
M2_
I mean, only 2 last are different, but 'cat' class works in IE6, and 'cet' doesn't
M2_
I'm not sure what you are saying. "cat" doesn't have mixed keywords and lengths in your example.
RoToRa
well, i tried different values of background position for 'cet' class, but it doesn't work in IE6
M2_
Maybe there is something wrong with your PNG file for cet. Can you see the image when you open the file directly in IE?
RoToRa
strange... if i change#header #logo.cet {background: url( ../img/logo_cet.png) no-repeat -10px -40px;}to#header #logo.cet {background: url( ../img/logo_cat.png) no-repeat -1px 0px;}it doesn't work again in IE6
M2_
i can open the file in any browser.i tried to add a background color, and i can not see the color in IE6, damn
M2_
Sorry, I'm out out ideas. You'll probably need to post a URL.
RoToRa
new.master-cet.customs.ruAlso, i added red border to the a#logo but no result again
M2_
the problem was in order of classes, i placed 'cet' berofe 'cat' and it fixed the problem
M2_