You’ve seen progress bars everywhere, they are those bars that display the current completion state for a process, such as a download or a file transfer. Whether you’re building a desktop or a web application, at a certain point, you may need to use this UI element.
Having said that, in this article, you’ll learn how to create stylish and animated progress bars using CSS3.
You may have seen this CSS3 technique before, I just adapted it a little for this example:
Shining effect
Not sure if this is the best name I could find for this CSS3 animation, but here we go:
This CSS3 progress bar example uses an CSS3 ::afterpseudo-element which animates. Currently, animating generated content with CSS3 is available only on latest Firefox browsers. I hope that soon it will be better support for that.
Glow effect
CSS3 keyframes animation based on box-shadow property:
Hey, what about older browsers?
The progress bars look pretty well thanks to graceful degradation.
That’s all!
For further web development, to achieve the result you wish for, you just need to play with JavaScript or jQuery to change the span’s width value for these progress bars.
I hope you liked this tutorial, please feel free to share your thoughts. Thanks for reading!
Update
I just added some jQuery to the demo page. So, now you can also play with progress bars’ values.