Build an Infinite Scroll Animation Effect Using Only CSS

  Рет қаралды 16,485

Optimistic Web

Optimistic Web

Күн бұрын

This step-by-step CSS tutorial teaches how to design and implement an infinite CSS scroll animation effect using only HTML and CSS. In this video, we'll cover everything you need to know to create a seamless scrolling effect for stock symbols, prices, and changes, without relying on JavaScript. Learn how to craft an infinite stock ticker, logo carousel or news ticker that seamlessly scrolls through content, adding a touch of flair to your website.
Discover the power of CSS marquee animations as we demonstrate how to achieve an infinite scrolling effect without the need for JavaScript. From creating an infinite autoplay slider to crafting a horizontal stock ticker, our tutorial covers a range of techniques to elevate your web design skills. Watch now and level up your website with a dynamic and engaging scroll animation.
Like, share, and subscribe to our channel for exciting web development tutorials.
Live Demo: codepen.io/optimisticweb/pen/...
Related Topics
-----------------------------------------------------
- Infinite Scrolling Animation
- Infinite Marquee Animation With Pure CSS
- How To Make An Infinite Autoplay Slider
- Pure CSS Infinite News Ticker Scrolling Animation Effects
- Creating an infinite logo carousel with pure CSS
- How to Create a Horizontal News Ticker with CSS Only
Chapters
-----------------------------------------------------
00:00 Intro
00:34 The deprecated marquee tag
00:55 HTML for the infinite scroll animation
01:31 CSS for the infinite stock ticker
04:39 Fix scroll animation for a smoother effect
Subscribe and never miss a beat
-----------------------------------------------------
🔔 Subscribe for more videos like this: www.youtube.com/@OptimisticWe...
Learn at your own pace
-----------------------------------------------------
- Learn HTML - • HTML
- Learn CSS - • CSS
- Learn JavaScript - • JavaScript
Connect, share, and grow
-----------------------------------------------------
- KZbin: / @optimisticweb
- X (Twitter): / optimisticweb
- Instagram: / optimisticweb
- Facebook: / optimisticweb
- CodePen: codepen.io/optimisticweb
#css #infinitescroll #cssscrolling #cssmarquee #cssanimation #webdesign #cssmagic #csstutorial #html #cssforbeginners #webdevtutorial #learncss #learnhtml #optimisticweb

Пікірлер: 56
@OptimisticWeb
@OptimisticWeb 4 ай бұрын
Try and experiment with the code at the link provided in the description.
@robertodepasamonte3434
@robertodepasamonte3434 4 ай бұрын
Awesome and very well presented tutorial. Thank you for sharing, and for providing the codepen demo.
@OptimisticWeb
@OptimisticWeb 4 ай бұрын
You're welcome, glad you enjoyed it.
@biggand8520
@biggand8520 4 ай бұрын
Cool, as always, especially I like that little thing with animation pause when hovering over
@OptimisticWeb
@OptimisticWeb 4 ай бұрын
Thank you! That animation pause not only adds a nice touch but also enhances the overall user experience.
@chriscarton4728
@chriscarton4728 2 ай бұрын
Thank you this, very clean code !🖥
@OptimisticWeb
@OptimisticWeb 2 ай бұрын
Thank you! Glad you liked it.
@thenightwolf224
@thenightwolf224 4 ай бұрын
Your Channel Is AMAZING KEEP GOING BUDDY
@OptimisticWeb
@OptimisticWeb 4 ай бұрын
Thank you! Your support means a lot.
@RobertMcGovernTarasis
@RobertMcGovernTarasis 4 ай бұрын
Bloody clever!
@OptimisticWeb
@OptimisticWeb 4 ай бұрын
Thanks a bunch!
@Jashandeep31
@Jashandeep31 4 ай бұрын
Thanks Man 🤞🤞
@OptimisticWeb
@OptimisticWeb 4 ай бұрын
You're welcome!
@SharunKumar
@SharunKumar 4 ай бұрын
RIP
@OptimisticWeb
@OptimisticWeb 4 ай бұрын
Indeed, had its charm.
@borstenpinsel
@borstenpinsel 4 ай бұрын
It still works though...?​@@OptimisticWeb
@OptimisticWeb
@OptimisticWeb 4 ай бұрын
Yes, even though it is deprecated, it still works in many browsers.
@JamilKhan-hk1wl
@JamilKhan-hk1wl 4 ай бұрын
Not recommended as it could be removed anytime​@@borstenpinsel
@TwoLeggedTriceratops
@TwoLeggedTriceratops 4 ай бұрын
Has browsers removed any deprecated tags since 00’s?
@ishigod7346
@ishigod7346 2 ай бұрын
I love you was just what I needed
@OptimisticWeb
@OptimisticWeb 2 ай бұрын
Glad to hear I could be of some help.
@MatthewNicholsDevGuy
@MatthewNicholsDevGuy 4 ай бұрын
Nice approach
@OptimisticWeb
@OptimisticWeb 4 ай бұрын
Thank you!
@vivoiswatching929
@vivoiswatching929 4 ай бұрын
web technology is really ineffcient. great tutorial btw.
@OptimisticWeb
@OptimisticWeb 4 ай бұрын
Thank you!
@maicon484
@maicon484 4 ай бұрын
👏👏👏👏👏
@philipbailey8479
@philipbailey8479 28 күн бұрын
Thank you, this is an amazing tutorial. I'm trying to use this for my website menu and I would like alternating rows to be moving in reverse. How can I achieve that? Currently I've got rows 2 and 4 scrolling the opposite way but they're leaving a big gap behind them and then it just resets.
@OptimisticWeb
@OptimisticWeb 28 күн бұрын
Thank you! I'm glad you found the tutorial helpful. If you can share your CodePen, I can take a look and help debug the issue. Just a heads-up, adding multiple animations like this on a page can negatively affect performance and user experience, so it's worth considering the overall impact.
@user-qj4rr1rm8i
@user-qj4rr1rm8i 4 ай бұрын
This is a very useful tip. But I have a question about it. As I understood, we need a twin which has no meaning for the html document but required only for this fluid scroll effect right? I think this kind of approach is not a proper way of web accessibility, especially for people who rely on screen readers. What about adding some Javascript? I think adding some margin attribute for next marquee queue .. something like that will make it perfect. Your tips and creative way of approach is always appreciated. And I love it. Thanks.
@OptimisticWeb
@OptimisticWeb 4 ай бұрын
That's why, at 05:05, I talked about adding an aria-hidden attribute. It helps remove duplicated elements from the accessibility tree, so screen readers don't get mixed up. Also, when you use JS for carousels, it often creates duplicate elements on the fly. The main point of this video was to show how to make an endless loop using only CSS. Hope this helps.
@user-qj4rr1rm8i
@user-qj4rr1rm8i 4 ай бұрын
@@OptimisticWeb Aha!!! I missed the area-hidden part. Sorry that I missed it. Your works are great. Just keep on.
@OptimisticWeb
@OptimisticWeb 4 ай бұрын
No problem, and thanks for your support.
@AlThePal78
@AlThePal78 4 ай бұрын
I will do this and add an api for stocks
@OptimisticWeb
@OptimisticWeb 4 ай бұрын
That sounds like a plan! Please share once it's done.
@CristianKirk
@CristianKirk 4 ай бұрын
No one ever really explains why the marquee tag is "deprecated" and it just keeps being supported by most browsers if not all. The only real issue with marquee is simply that there's no way to avoid the empty space at the ends of each cycle. Maybe someday we'll get something like this: Some Content
@OptimisticWeb
@OptimisticWeb 4 ай бұрын
To the best of my knowledge, the marquee tag was never officially included in W3C specifications. Though it still works in many browsers, it seems there hasn't been much effort to enhance or standardize it.
@JamilKhan-hk1wl
@JamilKhan-hk1wl 4 ай бұрын
The logic is html is suppose to show what the content is not to show animations.
@OptimisticWeb
@OptimisticWeb 4 ай бұрын
@@JamilKhan-hk1wl A valid point...
@devxsadik
@devxsadik 4 ай бұрын
Srsly, Someone should create a petition for bringing marquee back 2 life (Yes, I know it still works, but please remove that deprecated label and make improvement on it)
@OptimisticWeb
@OptimisticWeb 4 ай бұрын
Removing the deprecated label and improving it further would be interesting. Who knows, maybe someday..!
@user-iw3kq3mn8j
@user-iw3kq3mn8j 4 ай бұрын
It's good in general, but if you are going to use it in real progect it would not be okay. Due to the fact that it is immediately scroll back when first ul finished, and it has bad user experience, because it stops on the middle of the second ul at the same time.
@user-iw3kq3mn8j
@user-iw3kq3mn8j 4 ай бұрын
Other words animation is not great in details
@OptimisticWeb
@OptimisticWeb 4 ай бұрын
Thanks for your input. Regarding user experience, we've already got the aria-hidden attribute set up for screen readers. Plus, when the first UL replaces its copy, their positions and visual attributes are exactly the same so that no human eye can catch it. Also, there's a hover effect to let users pause the animation when they want to interact. But, of course, there are several ways to achieve the same effect including the use of JavaScript. The aim of this video is to demonstrate a CSS-only approach to creating an infinite loop.
@seabeckstarlite
@seabeckstarlite 4 ай бұрын
in a real project you would pull however many stocks you want from a database or something and have javascript to put the ul lists in twice.
@OptimisticWeb
@OptimisticWeb 4 ай бұрын
Absolutely! JS-based carousels often clone elements at runtime.
@johnryder8464
@johnryder8464 4 ай бұрын
Why did they get rid of the marquee tag? Idiotic move.
@OptimisticWeb
@OptimisticWeb 4 ай бұрын
From what I understand, the marquee tag had limitations and didn't align well with accessibility and modern design principles. However, it still works in many browsers.
@johnryder8464
@johnryder8464 3 ай бұрын
I don't buy that argument. In the end I built an infinite scroller using vanilla js and css key frames which can be turned off on mobile devices.
@OptimisticWeb
@OptimisticWeb 3 ай бұрын
It could have been improved if there were any issues with the marquee tag. Not sure why no one went down that path. Anyways, there are alternatives in the market, with or without JS.
@egozMaster
@egozMaster 4 ай бұрын
marquee is easiest
@OptimisticWeb
@OptimisticWeb 4 ай бұрын
Indeed, but deprecated.
@KayinAngel
@KayinAngel 4 ай бұрын
sorry. I noped out on unnecessarily duplicating the html.
@OptimisticWeb
@OptimisticWeb 4 ай бұрын
No worries! Each solution has its pros and cons. Also, many JS-based carousels duplicate elements dynamically. That's precisely why we included the aria-hidden attribute, to ensure screen readers stay on track. Appreciate your feedback!
@patriotir
@patriotir 10 күн бұрын
So much unnecessary info. Go straight to the point which is infinite scroll animation
@OptimisticWeb
@OptimisticWeb 10 күн бұрын
Thank you for your feedback! I appreciate your input and always strive to improve. These videos aim to include information that benefits developers of all levels, including beginners, so sometimes we need to set the foundation. Please let me know which parts you found unnecessary and where I could be more concise.
Creating Eye-Catching Circular Animations in CSS
0:58
Optimistic Web
Рет қаралды 17 М.
CSS Anchor Is The Best New CSS Feature Since Flexbox
15:39
Web Dev Simplified
Рет қаралды 363 М.
ЧУТЬ НЕ УТОНУЛ #shorts
00:27
Паша Осадчий
Рет қаралды 10 МЛН
Как бесплатно замутить iphone 15 pro max
00:59
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 8 МЛН
Llegó al techo 😱
00:37
Juan De Dios Pantoja
Рет қаралды 56 МЛН
23 CSS features you should know (and be using) by now
31:31
Kevin Powell
Рет қаралды 69 М.
Subtle, yet Beautiful Scroll Animations
5:04
Beyond Fireship
Рет қаралды 1,6 МЛН
These CSS PRO Tips & Tricks Will Blow Your Mind!
8:48
Coding2GO
Рет қаралды 150 М.
Learn CSS Flexbox in easy way
5:05
cssiseasy
Рет қаралды 20 М.
The Easiest Way to Build Websites
10:56
Sajid
Рет қаралды 405 М.
Auto Scrolling Text in Elementor (Infinite Marquee Effect)
6:31
Wicky Design
Рет қаралды 22 М.
You Don't Need JavaScript For This - CSS ONLY Infinite Scroll
23:35
Slaying The Dragon
Рет қаралды 82 М.
Create an infinite horizontal scroll animation
32:01
Kevin Powell
Рет қаралды 188 М.
Every CSS Animation property
9:26
chunkydotdev
Рет қаралды 62 М.
Supercharge Your Styling with CSS Custom Properties
6:54
Optimistic Web
Рет қаралды 1,7 М.
ЧУТЬ НЕ УТОНУЛ #shorts
00:27
Паша Осадчий
Рет қаралды 10 МЛН