Why does Chrome run transform animation on the main thread in some cases, and not in others?

Browser Threads Each browser has at least three threads; precisely what is run on each depends on the browser. Modern browsers all have more than three now, but they still have three categories of threads that will always be separate. Why? One will always be entirely separate and only accessible by the browser to handle … Read more

Apply CSS properties when transition ends

you can add a delay like this: transition: box-shadow 300ms, padding 300ms 400ms; The box-shadow transition will start on hover and last 300ms, and the padding will start after 400ms and again last 300ms. .something { background: blue; color: white; padding: 0px; background-clip: context-box; transition: box-shadow 300ms, padding 300ms 400ms; } .something:hover { box-shadow: 0px … Read more

How can I transition width of content with width: auto?

As I commented, one can’t animate auto (yet), so either use the max-width/max-height trick, or, if you need it to be more exact, set the width using a script. With the max-width/max-height trick, give it a value big enough to accommodate the widest. Stack snippet .myspan { display: inline-block; font-size: 30px; background-color: #ddd; vertical-align: bottom; … Read more

CSS3 Transition not working

A general answer for a general question… Transitions can’t animate properties that are auto. If you have a transition not working, check that the starting value of the property is explicitly set. Sometimes, you’ll want to animate height and width when the starting or finishing value is auto. (For example, to make a div collapse, … Read more

CSS transition fade in

CSS Keyframes support is pretty good these days: .fade-in { opacity: 1; animation-name: fadeInOpacity; animation-iteration-count: 1; animation-timing-function: ease-in; animation-duration: 2s; } @keyframes fadeInOpacity { 0% { opacity: 0; } 100% { opacity: 1; } } <h1 class=”fade-in”>Fade Me Down Scotty</h1>