0

I have a div where I set the background to fixed so that it has that the content scrolls over it. Just to clarify this is not for the entire page, just for a div.

It works in chrome and firefox (latest versions) but it doesn't work in safari (desktop or ios). I know I am using an old safari for desktop but it's because my computer doesn't support the later versions :(

Couldn't find any resources on this, Only referring to the body.

  • possible duplicate of [Using background-attachment:fixed in safari on the ipad](http://stackoverflow.com/questions/3011226/using-background-attachmentfixed-in-safari-on-the-ipad) – Vucko Mar 24 '14 at 17:00
  • it is not. That is for the body background which can have a fixed position for the entire container. I need the div to not be fixed, but the background fixed. See http://www.yourlocalwebmaster.com/ for example. "Parallax" is what some people call it – user3427494 Mar 24 '14 at 17:06
  • @user3427494 I know you clarified that you're using an outdated version of Safari because it's been discontinued on Windows but I have to stress why this I think this is a bad idea. Safari on Windows was discontinued on May 9, 2012 (going on two years now). There is no reason to think that testing on that old of a discontinued browser will result in anything close to the up to date versions (unless you're being forced to). – MiniRagnarok Mar 24 '14 at 17:15

1 Answers1

0

please use the below css style to make background fixed and to work in all the browser :)

.div_image{ background: url(images/bg.jpg) no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; }

Kiran
  • 125
  • 9
  • doesn't work. I don't think it supports it, otherwise I'm sure there would be tons of info on it. Thanks though – user3427494 Mar 24 '14 at 17:30