If I make the width change through a separate test click event everything works as expected.
Here's my JS and CSS:
var div = $('<div />').addClass('trans').css('width', '20px');
A cleaner approach that does not rely on setTimeout, is to read the css property in question before setting it:
var div = $('<div />').addClass('trans'); $('#container').append(div); div.css('width');//add this line div.css('width', '200px');
As explained in the comments below by Lucero, doing it this way is necessary to force the browser to calculate an actual value rather than "auto", "inherit" or similar. Without an actual value, the browser will not know the new value to be a change from the previous.