I have text links that I am trying to use a background image with on rollover (link.gif
is transparent, linkhover.gif
is the rollover image).
The code I have below is working except the positioning is not.
.navlink {
background:transparent url('graphics/link.gif') center top no-repeat;
height:70px;}
.navlink:hover {
background-image: url('graphics/linkhover.gif');}
Try making the background take up the full size, like this
Demo
If you have a parent element around
.navlink
, then you can just putheight:100%
and removeheight:70px;
and it will stay proportional. If you want to disregard proportion and just have it fill the parent you can put bothheight:100%
andwidth:100%
EDIT
Since I found out the
navlink
s are all<a>
: you can't havebackground-attachment: fixed
because it makes the parent's background change instead of thenavlink
's (for what reason I don't know)Updated code
Updated demo based on the structure of your site which you provided in the comments
Next time when writing your question you should include the relevant HTML, that would have made it much easier to help you with the problem
EDIT 2
After some playing I believe I got your site the way you want it using this: