标签:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>图片过渡效果示例</title> <style> div{ width: 1024px; height: 1024px; background: url("42-29407750.jpg"); transition: width 5s, height 5s; background-size: cover; } div:hover{ width: 2048px; height: 2048px; } </style> </head> <body> <div> </div> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>动画</title> <style type="text/css"> .dong{ width: 200px; height: 200px; border: 1px solid gray; margin: 0 auto; animation: dong 5s; border-bottom: 2px solid salmon; } @keyframes dong { 0%{ background: red; } 25%{ background: yellow; } 50%{ background: blue; } 100%{ background: green; }} .donghua2{ width: 400px; height: 400px; border: 2px solid gray; animation: donghua2 5s; font-size: 50px; color: aqua; text-align: center; /*text-decoration: underline;*/ line-height: 7em; } @keyframes donghua2 { 0%{ background: greenyellow; } 20%{ background: wheat; } 30%{ background: salmon; } 50%{ background: aqua; } 70%{ background: midnightblue; } 100%{ background: lightslategrey; } } </style> </head> <body> <div class="dong"></div> <div class="donghua2">这是一个动画</div> </body> </html>
标签:
原文地址:http://www.cnblogs.com/Lixuemei/p/5170486.html