Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Заголовок документа</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</h2> <div class="example"> <p>Наведите курсор мыши на контейнер и сами увидите результат.</p> <div class="element element-1"></div> <p>Нет перехода:</p> <div class="element element-2"></div> </div> </body> </html>