找到 1575 篇文章 关于 CSS
75 次浏览
您可以尝试运行以下代码来实现 `animation-timing-function` 属性:示例在线演示 div { width: 150px; height: 200px; position: relative; background-color: yellow; animation-name: myanim; animation-duration: 2s; animation-direction: alternate-reverse; animation-iteration-count: 3; } @keyframes myanim { from {left: 100px;} to {left: 200px;} } #demo1 {animation-timing-function: ease;} #demo2 {animation-timing-function: ease-in;} ease 效果 ease-in 效果
69 次浏览
使用 `animation-play-state` 属性来设置动画是正在运行还是暂停。您可以尝试运行以下代码来实现 `animation-play-state` 属性:示例在线演示 div { width: 150px; height: 200px; position: relative; background: red; animation-name: myanim; animation-duration: 2s; animation-play-state: paused; } @keyframes myanim { from {left: 0px; background-color: green;} to {left: 100px; background-color: blue;} }
91 次浏览
使用 `animation-name` 属性来设置 `@keyframes` 动画的名称。您可以尝试运行以下代码来实现 `animation-name` 属性:示例在线演示 div { width: 150px; height: 200px; background-color: yellow; animation-name: myanim; animation-duration: 3s; animation-delay: 3s; } @keyframes myanim { from { background-color: green; } to { background-color: blue; } }
91 次浏览
使用 `animation-iteration-count` 属性来设置 CSS 动画应该播放的次数。您可以尝试运行以下代码来实现 `animation-iteration-count` 属性示例在线演示 div { width: 150px; height: 200px; position: relative; background-color: yellow; animation-name: myanim; animation-duration: 2s; animation-direction: alternate-reverse; animation-iteration-count: 3; } @keyframes myanim { from {left: 100px;} to {left: 200px;} } #demo1 {animation-timing-function: ease;} #demo2 {animation-timing-function: ease-in;} ease 效果 ease-in 效果
198 次浏览
使用 CSS `background-origin` 属性来设置 `border-box` 值。使用 `border-box` 值,背景图像从边框的左上角开始。您可以尝试运行以下代码来实现 `border-box` 值:示例在线演示 #value1 { border: 3px solid blue; padding: 30px; background: url(https://tutorialspoint.com/assets/videotutorials/courses/html_online_training/380_course_216_image.jpg); background-repeat: no-repeat; background-origin: padding-box; } ... 阅读更多
136 次浏览
要将元素设置为保留由第一个关键帧设置的样式值,请使用 `animation-fill-mode` 属性和 `forwards` 值。示例在线演示 div { width: 150px; height: 200px; position: relative; background: red; animation-name: myanim; animation-duration: 2s; animation-fill-mode: forwards; } @keyframes myanim { from {left: 0px; background-color: green;} to {left: 200px; background-color: blue;} }