There seems to be a bug with Google Chrome version 36.0.1985.143, or I'm missing something here. Firefox and Safari seem to work as expected.
Checkout Demo video at Vimeo
Css transitions seem to work when loading a document when a form element is present in the following html document:
<!DOCTYPE html> <html> <head> <link rel="stylesheet" href="style.css" /> </head> <body> <div></div> <form></form> </body> </html>
And a simple css file: style.css
div { -webkit-transition:background-color 2s; -moz-transition:background-color 2s; -o-transition:background-color 2s; transition:background-color 2s; width: 188px; height: 188px; background-color: red; margin: 0 auto; } div:hover { background-color: green; }
The transition stops firing when the <form></form> element is deleted or when the rules of the style sheet are placed inside the main section of the document as follows:
<style> div { -webkit-transition:background-color 2s; -moz-transition:background-color 2s; -o-transition:background-color 2s; transition:background-color 2s; width: 188px; height: 188px; background-color: red; } </style>
Is this a real mistake, or am I doing something wrong?
PS: I do not have activated extensions, and this behavior also appears in incognito mode. In addition, these problems indicate whether the document is open in a browser through a folder or served from the actual apache web server.
When I recreate the βerrorβ on a similar question: The CSS transition defined in the external stylesheet causes the transition to load the page , it seems to be fixed. So far I have not changed the property of switching to the background color and, of course, have not added the <form></form> element ..
UPDATE: This seems to be a real bug in Chrome. Reported here and here . Although they will not fix it soon. Does anyone know a simple (css) hack / fix for this?
UPDATE2: Another demo