Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Background Image Doesn't Fixed on Mobile Devices

I've forced the background image of the body this site to fixed but somehow some mobile devices don't follow the rule. Any tips?

The grey swirly thing? It stays fixed on Chrome when minimized to mobile sizes, not tried on the iPad yet though as it's a challenge to get it off my girlfriend :)

4 Answers

When you scroll a mobile page some devices are not actually scrolling they are "moving around" a sized version of the page. Support for fixed backgrounds are limited. You can try something like modernizr and make a css rule for browsers that support fixed backgrounds and another rule for those that do not.

What's the css rule like for a Wordpress site?

Adam Sackfield Hi Adam, please help check on iPad and share your view. Thanks and happy weekend!

iPad Mini, background is not fixed (it scrolls off the screen)

Thanks @adamsackfield, have you tried making the background fixed on an ios device?

I've tried forcing it with background-attachment: fixed !important; but it doesn't work.

If you haven't found a solution yet you can try wrapping the page in a div and adding scroll bars to it and removing the standard browser scroll bars with css.