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

Optimising background-attachment: fixed

Hi Treehouse,

I'm working on a project that involves 2 instances of background-attachment: fixed. Ideally I'd like a third in there but I've turned it off for now as it's just a bit too much.

I know this question has been asked before and I've been digging around a lot trying to find an answer but:

Is there a way to optimise performance when using this property? The issue is that the page becomes a bit jittery when scrolling up and down.

I've used the will-change: transform trick as outlined here: https://www.fourkitchens.com/blog/article/fix-scrolling-performance-css-will-change-property

I've also used transform: translateZ(0) which from my understanding is a hacked way to create the same rendering trick that will-change does.

I've noticed a slight bit of difference with both of these. But ultimately the browser is not running silky smooth as I'd like it to be. Is this just a perennial issue that comes with using the fixed property? Or is there a way to make things nice and smooth?

Thanks,