国产成人精品18p,天天干成人网,无码专区狠狠躁天天躁,美女脱精光隐私扒开免费观看

如何使用CSS3實(shí)現動(dòng)畫(huà)效果

發(fā)布時(shí)間:2021-09-04 11:55 來(lái)源:億速云 閱讀:0 作者:小新 欄目: 開(kāi)發(fā)技術(shù)

這篇文章主要為大家展示了“如何使用CSS3實(shí)現動(dòng)畫(huà)效果”,內容簡(jiǎn)而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶領(lǐng)大家一起研究并學(xué)習一下“如何使用CSS3實(shí)現動(dòng)畫(huà)效果”這篇文章吧。

瀏覽器支持

Internet Explorer 10、Firefox 以及 Opera 支持 animation 屬性。

Safari 和 Chrome 支持替代的 -webkit-animation 屬性。

注釋?zhuān)篒nternet Explorer 9 以及更早的版本不支持 animation 屬性。

定義和用法

animation屬性是一個(gè)簡(jiǎn)寫(xiě)屬性,用于設置六個(gè)動(dòng)畫(huà)屬性:

  • animation-name

  • animation-duration

  • animation-timing-function animation-delay

  • animation-iteration-count animation-direction

語(yǔ)法

animation: name duration timing-function delay iteration-count direction;

關(guān)于keyframe的定義

  • Firefox支持替代的@-moz-keyframes規則;

  • Opera支持替代的@-o-keyframes規則;

  • Safari和Chrome支持替代的@-webkit-keyframes規則;

  • 取值支持 0-100% 和from,to。

@keyframes move {
  0% {
    top: 0px;
    left: 0px;
  }
  25% {
    top: 200px;
    left: 200px;
  }
  50% {
    top: 100px;
    left: 100px;
  }
  75% {
    top: 200px;
    left: 200px;
  }

  100% {
    top: 0px;
    left: 0px;
  }
}

@keyframes move {
  from {
    top: 0px;
    left: 0px;
  }
  to {
    top: 0px;
    left: 100px;
  }
}

demo 寫(xiě)了一個(gè)例子,地球繞太陽(yáng)轉

以下是代碼

<!-- html 部分 -->
<div style="width:700px; ">
  <div class="t">
    <div class="t1"></div>
  </div>
</div>
/* css 部分 */
@keyframes t {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@-webkit-keyframes t {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.t {
  height: 500px;
  width: 500px;
  position: relative;
  border-radius: 50%;
  transform: scale(.8);
  border: 1px solid #dedede;
  &::before {
    content: "";
    width: 50px;
    height: 50px;
    background: radial-gradient(72px, #f00, #ff0, #080);
    border-radius: 50%;
    position: absolute;
    left: 50%;
    top: 50%;
    margin-top: -25px;
    margin-left: -25px;
    box-shadow: 0 0 37px #fcff4a;
  }
  .t1 {
    height: 20px;
    border-radius: 50%;
    width: 20px;
    margin-top: -10px;
    top: 50%;
    left: -10px;
    background: radial-gradient(26px, #0082ff, #184608, #003ade);
    position: absolute;
    animation: t 3s infinite linear;
    transform-origin: 260px center;
  }
}

</style>

免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng )、來(lái)自互聯(lián)網(wǎng)轉載和分享為主,文章觀(guān)點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權請聯(lián)系QQ:712375056 進(jìn)行舉報,并提供相關(guān)證據,一經(jīng)查實(shí),將立刻刪除涉嫌侵權內容。

亚洲欧洲美色一区二区三区| 无码射肉在线播放视频| 欧美人与动牲交欧美精品| 成全视频高清免费观看中国电视剧| 欧美最猛黑人XXXX黑人猛交| 国产无遮挡又黄又爽免费视频|