Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ie7 not showing link background image?

Status
Not open for further replies.

MrMiyagi

Technical User
Feb 11, 2009
43
FI
Hello,

Im in trouble..I have an anchor link with a background hover image that is defined in css. Everything works well except ie7(ie6 is not needed thank god). It does not show the background image for this link. I can get background color, but image wont work...Id be thankful for some advice how to get the bg image visible on ie7.

I need to hold on to this div structure. Here is my html and css:

<div id="container">
<div id="box">
<a href="#" class="linkclass" onclick="showpopup();">click here</a>
</div>
</div>


#container {
width:276px;
min-height:616px;
float:right;
}

#box{
background: url(boxbg.png) no-repeat; /*works ok*/
min-height:562px;
width:276px;
font-size:17px;
}

a.linkclass {
background:url(bg.png)no-repeat scroll center center; /*not working */
overflow:visible;
color:white;
cursor:pointer;
width: 204px;
height:21px;
margin-left:14px;
font-size:13px;
text-align: center;
padding:20px;
}

a.linkclass:hover {
background: url(bg.png)no-repeat scroll center center; /*not working*/
color:black;
}

 
1. Add display: block; to your anchor class. Being inline by default, it shouldn't have accepted width and height attributes. However, if your background should be showing behind the 'click here' words, this is probably not it.
2. Try adding a space between url(bg.png) and no-repeat. That could be throwing IE off.

[small]Do something about world cancer today: Comprehensive cancer control information at PACT[/small]
 
That was it!

"Try adding a space between url(bg.png) and no-repeat. That could be throwing IE off."

Thank you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top