W
W
WhatIsHTML2017-05-18 13:24:56
iPhone
WhatIsHTML, 2017-05-18 13:24:56

How to fix a bug on iphone?

There is a section that goes full screen height. The background should have an image with the background-attachment: fixed property. Those. the background image does not go beyond the section. But on iOS Safari there is a bug - the image is not visible. Here is what is written about this on caniuse

iOS Safari has buggy behavior with background-size: cover; + background-attachment: fixed;

How can I achieve this effect on iOS? I made an example in a slightly different way, but the picture goes beyond the red frame. How to make sure that the image does not go beyond the frame when scrolling?
https://jsfiddle.net/wt6u2j61/

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alvvi, 2017-05-19
@alvvi

https://caniuse.com/#search=background-attachment
No buggy behavior, everything is very expected, it is not supported in mobile browsers, and it seems like no one has managed to recreate it only using css, at least I did not find a suitable polyfill .
JS with its bunch of parallax libraries to help.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question