Parallax with One Line of CSS #css #html #programming #webdevelopment #coding #frontend

preview_player
Показать описание
Parallax scrolling has been a popular effect on the web for decades now. It's generally accomplished using JavaScript to control multiple layers of elements on your page, moving them at differing rates while you scroll.

But what if we could accomplish this with JUST CSS? Well, that's what the background-attachment: fixed; property is for!

It's not particularly flexible, but if you're looking to add that traditional fixed background effect to your site, this is by far the easiest way to do it!
Рекомендации по теме
Комментарии
Автор

Awesome, keep going! Class is not hero, the real hero is you :) subscribed ❤

feritkardal
Автор

Safari on iOS doesn't support background-attachment: fixed.

ahh.g
Автор

This doesn’t work for mobile browsers, view it on your iPhone for example to see the incompatibility

xreed
welcome to shbcf.ru