IE issue i've never seen. Background PNG image moving up 1px on hover.

Discussion in 'CSS' started by js09, Nov 9, 2010.

  1. #1
    http://jeffsimpsonphoto.com/

    If you looks at the main header links (read, wedding, engagement, kudos, etc.) in IE they seem to have this ugly 'shadow' on mouse hover. There is definitely something off in my code. I just need each 'link' to move up 1px, it works fine in FF.

    Any ideas?

    Code is this:
    
    #nav {
    	width: 965px;
    	height: 57px;
    	position: absolute;
    	left: 0;
    	bottom: 0;
    	background-image: url(../images/nav_bg.png);
    	background-repeat: no-repeat;
    	background-position: 0 0;
    }
    
    #nav li {
    	float: left;
    	margin: 0 51px 0 0;
    }
    
    #nav ul {
    	margin: 24px 0 0 66px;;
    	padding: 0;
    }
    
    
    
    .nav1 {
    	display: block;
    	width: 37px;
    	height: 11px;
    	background-image: url("http://jeffsimpsonphoto.com/images/read.png");
    	background-repeat: no-repeat;
    	background-position: 0 1px;
    }
    
    Code (markup):
    ty!!
     
    js09, Nov 9, 2010 IP
  2. workingsmart

    workingsmart Well-Known Member

    Messages:
    411
    Likes Received:
    12
    Best Answers:
    9
    Trophy Points:
    120
    #2
    it's your css:


    In all navs you have:
    
    	background-position: 0 1px;
    
    Code (markup):
    On the hover you have:
    
    	background-position: 0 0px;
    
    Code (markup):
    So there's your one pixel...... Change the navs to 0 0 or the hover to 0 1px

    Cheers!~
     
    workingsmart, Nov 9, 2010 IP
  3. radiant_luv

    radiant_luv Peon

    Messages:
    1,327
    Likes Received:
    34
    Best Answers:
    1
    Trophy Points:
    0
    #3
    I think it's the support for opacity PNG format issue for IE.

    Did you try, msfilter for IE, i think you need to add
    -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
    Code (markup):
    to the class in your css.

    alternatively, there is hack; a image behavior is added to the css and which makes sure PNG images are tranparent for iE 6 and IE browsers. May be you can give a try http://bjorkoy.com/2007/04/the-easiest-way-to-png/
     
    radiant_luv, Nov 9, 2010 IP
  4. workingsmart

    workingsmart Well-Known Member

    Messages:
    411
    Likes Received:
    12
    Best Answers:
    9
    Trophy Points:
    120
    #4
    For image quality, ==^ above is correct.... But the 1 pixel is because of the stylesheet. The image quality is displaying differently in Chrome, IE, Opera and FF because the output of the png isn't so hot...

    Cheers!~
     
    workingsmart, Nov 9, 2010 IP
  5. js09

    js09 Peon

    Messages:
    232
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Hmm, well i'm using IE8.. it shouldn't need any PNG hack right?

    The image displays correctly, up until you hover over it. So it's rendering fine.. up until that point. i DO want the image to move up by 1px.

    thanks for the help thus far
     
    js09, Nov 10, 2010 IP
  6. js09

    js09 Peon

    Messages:
    232
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I fixed it. for some reason there was a 50% opacity applied to the hover... oops
     
    js09, Nov 10, 2010 IP
  7. workingsmart

    workingsmart Well-Known Member

    Messages:
    411
    Likes Received:
    12
    Best Answers:
    9
    Trophy Points:
    120
    #7
    You know, I am so sorry - I completely brain farted on this one and misread your original post......... Sorry!!! ugh...
     
    workingsmart, Nov 10, 2010 IP