Reputation: 1
I have two divs. The right one contains an image and the left one contains 4 links. Left div has z-index: 1
and position: absolute
, and right div has z-index: 2; position:relative
.
Links are display: block
. So the goal is, when I hover on a link, the background image should change, which I have no problem with. The problem is that the background image is 20px wider than the link, and I want those 20px to appear on top of div one, which is why I use z-index
. But when a background-image is changed, the image starts from the left end of the link. Thus, those 20px appear to the right, not to the left on top of div one.
Can the background-image start from the right end of the link and so, the background-image will appear on top of the image in div one?
Upvotes: 0
Views: 313
Reputation: 127
background: url("../images/img.png") repeat scroll right top transparent;
this might be useful.
Upvotes: 1