steps() is a relatively new addition to the CSS3 animations module. Instead of interpolating the values smoothly, it allows us to define the number of “frames” precisely. So I used it to create headers that have the well-known animated “typing effect”:
As you can see, the number of characters is hardcoded in the steps() function, but that’s the only place. Everything else is totally flexible. Apart from the font: It has to be monospace, so that every character has the same width.
Also, this particular way requires a solid background and an extra <span>. You can avoid these limitations by directly animating the width of the heading itself, but this requires a fixed target width hardcoded in the animation, so 2 things that need to be changed for every heading:
If you’re having trouble understanding how it works, take a look at this simpler example, with just the cursor.
Gecko (Firefox) and Webkit only at the moment, since other engines haven’t implemented CSS animations yet. However, both examples degrade very gracefully in other browsers (IMO at least).
Pingback: Elegant D » steps()
Pingback: Lea Verou – Pure CSS3 typing animation with steps() – Yostivanich
Pingback: My Stream » steps()
Pingback: steps() | Freelancing Help
Pingback: wp-coder.net » steps()
Pingback: Taking steps() with CSS animations ✩ Mozilla Hacks – the Web developer blog
Pingback: BlogBuzz September 10, 2011
Pingback: Some links for light reading (14/9/11) | Max Design
Pingback: CSS Animations on Top10.com » Broken Links
Pingback: ezsimplydesigns.com » Blog Archive » Some links for light reading (14/9/11)
Pingback: Linkdump #63: CSS3:CSS 3:1 na wyjeździe. « Tomasz Kowalczyk
Pingback: Simpler typing animation, with the ch unit | Lea Verou
Pingback: Pure CSS3 typing animation with steps() | HTML 5 Examples
Pingback: Weekly Digest for June 15th | BiscuitJam Blog
Pingback: CSS3 Transitions: Thank God We Have A Specification!Feeds | Feeds
Pingback: CSS3 Transitions: Thank God We Have A Specification! | Society of Global Technocrats
Pingback: CSS3 Transitions: Thank God We Have A Specification! - rehavaPress
Pingback: Mymarketing » CSS3 Transitions: Thank God We Have A Specification!
Pingback: CSS3 Transitions: Thank God We Have A Specification! | Photography in Australia
Pingback: CSS3 Transitions: Thank God We Have A Specification! | DigitalMofo
Pingback: CSS3 Transitions: Thank God We Have A Specification!
Pingback: Today’s Links | JohnAspinall.co.uk
Pingback: CSS3 Transitions: Thank God We Have A Specification! - Pittsburgh Web Design & Hosting
Pingback: CSS3 Transitions: Thank God We Have A Specification! – BeeWorks Web Design and Digital Marketing Specialist based in Cagayan de Oro Philippines
Pingback: CSS3 Transitions: Thank God We Have A Specification! | Diancin Designs
Pingback: CSS3 Transitions: Thank God We Have A Specification! | Affordable Website Design - Wordpress Website Development
Pingback: UX News & Links April 30, 2013 | Erie Design Partners
Pingback: Thank God We Have A Specification! | Smashing Coding
Pingback: CSS3 Transitions: Thank God We Have A Specification! - Webinest : Webinest
Pingback: CSS3 Transitions: Thank God We Have A Specification! | Kleinburd News
Pingback: CSS3 Transitions: Thank God We Have A Specification! | Tuts – Infos++