Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Title of the document</title> <style> body { background-color: #fff; color: #000; font-size: 1em; font-family: 'Roboto', Helvetica, sans-serif; } .element { padding: 20px; width: 50px; height: 50px; left: 0; background-color: #8ebf42; position: relative; -webkit-transition: left 1s ease-in-out, background-color 1s ease-out 1s; -moz-transition: left 1s ease-in-out, background-color 1s ease-out 1s; -o-transition: left 1s ease-in-out, background-color 1s ease-out 1s; transition: left 1s ease-in-out, background-color 1s ease-out 1s; } .example:hover .element { left: 400px; background-color: #1c87c9; } .element-2 { -webkit-transition: none; -moz-transition: none; -o-transition: none; transition: none; } </style> </head> <body> <h2>Transition property example</h2> <div class="example"> <p>Hover over the container to see the transition effect.</p> <div class="element element-1"></div> <p>No transition:</p> <div class="element element-2"></div> </div> </body> </html>