CSS3新增的动画帧非常绚丽,可以简单实现一些动画效果,目前除IE外各大主流浏览器都支持
本文演示三个:transform: scale3d(x, y, z)-缩放;、transform: translate3d(x, y, z)-位移;、transform:rotateX/Y(?deg)-旋转;
演示地址:http://wjf444128852.github.io/demo02/css3/index.html
@keyframes 动画名{}
@-处理兼容性-keyframes<br />animation: expand 0.6s ease-out infinite;[动画名 动画执行时间 动画速度 动画次数]<br />-处理兼容-animation:
<html lang="en"><head> <meta charset="UTF-8"> <title>CSS3</title> <link rel="stylesheet" href="index.css"></head><body> <div class="parent"> <div class="main"></div> <div class="d2"></div> <div class="d3">A</div> </div></body></html>
html,body{ width: 98%; height: 98%; } /*方法二*/ body{ display: flex; align-items: center;/****水平居中****/ justify-content: center;/*垂直居中*/ } .parent{ overflow: hidden; width: 500px; height: 400px; background: orange; /*方法一*/ /*margin: 0 auto;*/ position: relative; /*top: 50%;*/ /*margin-top: -200px;*//***此行等于transform:translateY(-50%)******/ } .parent div{ width: 100px; height:100px; margin: 0 auto; margin-top: 20px; } .main{ position: relative; /*top:150px;*/ background: pink; -webkit-animation: expand 0.6s ease-out infinite; -moz-animation: expand 0.6s ease-out infinite; -o-animation: expand 0.6s ease-out infinite; -ms-animation: expand 0.6s ease-out infinite; animation: expand 0.6s ease-out infinite; } .d2{ background: green; -webkit-animation: bounce 3s ease-out infinite; -moz-animation: bounce 3s ease-out infinite; -o-animation: bounce 3s ease-out infinite; -ms-animation: bounce 3s ease-out infinite; animation: bounce 3s ease-out infinite; } @keyframes bounce { 0% { transform: translate3d(0, -25px, 0); opacity: 0; } 25% { transform: translate3d(0, 10px, 0); } 50% { transform: translate3d(0, -6px, 0); } 75% { transform: translate3d(0, 2px, 0); } 100% { transform: translate3d(0, 0, 0); opacity: 1; } } @-webkit-keyframes bounce { 0% { transform: translate3d(0, -25px, 0); opacity: 0; } 25% { transform: translate3d(0, 10px, 0); } 50% { transform: translate3d(0, -6px, 0); } 75% { transform: translate3d(0, 2px, 0); } 100% { transform: translate3d(0, 0, 0); opacity: 1; } } @-moz-keyframes bounce { 0% { transform: translate3d(0, -25px, 0); opacity: 0; } 25% { transform: translate3d(0, 10px, 0); } 50% { transform: translate3d(0, -6px, 0); } 75% { transform: translate3d(0, 2px, 0); } 100% { transform: translate3d(0, 0, 0); opacity: 1; } } @-o-keyframes bounce { 0% { transform: translate3d(0, -25px, 0); opacity: 0; } 25% { transform: translate3d(0, 10px, 0); } 50% { transform: translate3d(0, -6px, 0); } 75% { transform: translate3d(0, 2px, 0); } 100% { transform: translate3d(0, 0, 0); opacity: 1; } } @keyframes expand { 0% { transform: scale3d(1, 0, 1); } 25% { transform: scale3d(1, 1.2, 1); } 50% { transform: scale3d(1, 0.85, 1); } 75% { transform: scale3d(1, 1.05, 1); } 100% { transform: scale3d(1, 1, 1); } } @-webkit-keyframes expand { 0% { transform: scale3d(1, 0, 1); } 25% { transform: scale3d(1, 1.2, 1); } 50% { transform: scale3d(1, 0.85, 1); } 75% { transform: scale3d(1, 1.05, 1); } 100% { transform: scale3d(1, 1, 1); } } @-moz-keyframes expand { 0% { transform: scale3d(1, 0, 1); } 25% { transform: scale3d(1, 1.2, 1); } 50% { transform: scale3d(1, 0.85, 1); } 75% { transform: scale3d(1, 1.05, 1); } 100% { transform: scale3d(1, 1, 1); } } @-o-keyframes expand { 0% { transform: scale3d(1, 0, 1); } 25% { transform: scale3d(1, 1.2, 1); } 50% { transform: scale3d(1, 0.85, 1); } 75% { transform: scale3d(1, 1.05, 1); } 100% { transform: scale3d(1, 1, 1); } } /*transform:rotate3d(x,y,z,deg);*/ /*transform:rotate3d(1,1,0,45deg);*/ .d3{ background: #e4393c; -webkit-animation: move 3s linear infinite; -moz-animation: move 3s linear infinite; -ms-animation: move 3s linear infinite; -o-animation: move 3s linear infinite; animation: move 3s linear infinite; } @-o-keyframes move{ 25%{ transform:rotateY(45deg); } 50%{ transform:rotateY(360deg); } 75%{ transform:rotateX(45deg); } 100%{ transform:rotateX(180deg); } } @-moz-keyframes move{ 25%{ transform:rotateY(45deg); } 50%{ transform:rotateY(360deg); } 75%{ transform:rotateX(45deg); } 100%{ transform:rotateX(180deg); } } @-webkit-keyframes move{ 25%{ transform:rotateY(45deg); } 50%{ transform:rotateY(360deg); } 75%{ transform:rotateX(45deg); } 100%{ transform:rotateX(180deg); } } @keyframes move{ 25%{ transform:rotateY(45deg); } 50%{ transform:rotateY(360deg); } 75%{ transform:rotateX(45deg); } 100%{ transform:rotateX(180deg); } }

The roles of HTML, CSS and JavaScript in web development are: 1. HTML defines the web page structure, 2. CSS controls the web page style, and 3. JavaScript adds dynamic behavior. Together, they build the framework, aesthetics and interactivity of modern websites.

The future of HTML is full of infinite possibilities. 1) New features and standards will include more semantic tags and the popularity of WebComponents. 2) The web design trend will continue to develop towards responsive and accessible design. 3) Performance optimization will improve the user experience through responsive image loading and lazy loading technologies.

The roles of HTML, CSS and JavaScript in web development are: HTML is responsible for content structure, CSS is responsible for style, and JavaScript is responsible for dynamic behavior. 1. HTML defines the web page structure and content through tags to ensure semantics. 2. CSS controls the web page style through selectors and attributes to make it beautiful and easy to read. 3. JavaScript controls web page behavior through scripts to achieve dynamic and interactive functions.

HTMLisnotaprogramminglanguage;itisamarkuplanguage.1)HTMLstructuresandformatswebcontentusingtags.2)ItworkswithCSSforstylingandJavaScriptforinteractivity,enhancingwebdevelopment.

HTML is the cornerstone of building web page structure. 1. HTML defines the content structure and semantics, and uses, etc. tags. 2. Provide semantic markers, such as, etc., to improve SEO effect. 3. To realize user interaction through tags, pay attention to form verification. 4. Use advanced elements such as, combined with JavaScript to achieve dynamic effects. 5. Common errors include unclosed labels and unquoted attribute values, and verification tools are required. 6. Optimization strategies include reducing HTTP requests, compressing HTML, using semantic tags, etc.

HTML is a language used to build web pages, defining web page structure and content through tags and attributes. 1) HTML organizes document structure through tags, such as,. 2) The browser parses HTML to build the DOM and renders the web page. 3) New features of HTML5, such as, enhance multimedia functions. 4) Common errors include unclosed labels and unquoted attribute values. 5) Optimization suggestions include using semantic tags and reducing file size.

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

The role of HTML is to define the structure and content of a web page through tags and attributes. 1. HTML organizes content through tags such as , making it easy to read and understand. 2. Use semantic tags such as, etc. to enhance accessibility and SEO. 3. Optimizing HTML code can improve web page loading speed and user experience.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Dreamweaver CS6
Visual web development tools

Atom editor mac version download
The most popular open source editor

Zend Studio 13.0.1
Powerful PHP integrated development environment

SublimeText3 Mac version
God-level code editing software (SublimeText3)

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software