0

I'm adding class through script to <strong></strong> background-color:transparent; is OK in chrome and firefox
but in IE adds black color around image menu_bg.png

How to remove black background of image?

script

$("#navlist li a").hover(function() {  

    $(this).parent().find('strong').addClass("hover");

 }); 

CSS

.hover{ 
        display: inline-block;
        position:absolute;
        background: url(images/menu_bg.png) center no-repeat;
        background-color:transparent;
      } 

HTML

   <ul id="navlist"> 
       <li><a href="about.php">About Us</a><strong></strong></li>
   </ul>
5
Contributors
9
Replies
12
Views
5 Years
Discussion Span
Last Post by vizz
0

Try to change the CSS definition to...

.hover{
  display: inline-block;
  position: absolute;
  background: transparent url(images/menu_bg.png) center no-repeat;
}

Then see what happen?

0

background: transparent url(images/menu_bg.png) center no-repeat;

not working still black color around image

0

now color appears only to left,right and bottom
black color from top gone

0

What IE version are you using? Also, make sure that the browser doesn't save the old display value (either close the browser or refresh it with Ctrl+F5). Working with CSS sometimes has that problem (browser does not let go old CSS values).

Edited by Taywin

0

i'm using IE8 restarting browser doesn't work

0

What do you mean by 'A black color around image'? Send us a screenshot of how it looks like in Firefox/Chrome and how it looks in IE

0

I found an article that might help you. You would want to use an RGBa background to set the background color for all but IE. Then use a gradient for IE.

This article explains it in pretty good detail with some sample css code:

Click Here

0

I found an article that might help you. You would want to use an RGBa background to set the background color for all but IE. Then use a gradient for IE.

This article explains it in pretty good detail with some sample css code:

Click Here

Thanks
Problem solved

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.