On my page I have an element with the following CSS rules:
.pointer {
position: fixed;
background-repeat: no-repeat;
background-position: center;
top: 70%;
z-index: 1;
width: 3%;
height: 6%;
text-indent: 100%;
white-space: nowrap;
overflow: hidden;
float: left;
left: 0;
background-image: url("img/myImage.jpg");
}
Works good in the browsers I tested, only Opera does not like it. When I scroll, the background image also gets “scrolled” and therefore disappears as is gets out of the container.
I believe that is a known problem, but still I wasn’t able to find a solution.
On this page a method is described how to hide CSS rules from Opera, but besides the fact that this post is anno 2002, I actually don’t want to use CSS hacks.
Removing overflow: hidden does not fix it, adding background-attachment: fixed didn’t help either. Any other ideas or solutions?
I have taken a look at your fiddle project. I believe that the problem is caused by having the background image and border radius applied to the same element, I honestly can’t explain why this only happens in opera.
But a simple solution is to wrap the anchor in a div and split the styling between each, ensuring that the background image and radius are on separate elements.
I have created a fiddle with a possible solution, it needs some tidying up but I think it will get you on track – http://jsfiddle.net/zyj6Z
The CSS is below:
and HTML here:
I hope this helps.