日日操夜夜添-日日操影院-日日草夜夜操-日日干干-精品一区二区三区波多野结衣-精品一区二区三区高清免费不卡

公告:魔扣目錄網為廣大站長提供免費收錄網站服務,提交前請做好本站友鏈:【 網站目錄:http://www.ylptlb.cn 】, 免友鏈快審服務(50元/站),

點擊這里在線咨詢客服
新站提交
  • 網站:51998
  • 待審:31
  • 小程序:12
  • 文章:1030137
  • 會員:747

The craft of website creation frequently necessitates scrupulous scrutiny of particulars and a perceptive comprehension of elegance. A fundamental component that can enhance the user’s encounter with a website is animation. Nevertheless, the potency of an animation is largely hinged upon the time it takes to culminate. Truly, the chronometric facet of an animation is a critical variable in crafting a visually enthralling and engaging online adventure. Consequently, in this composition, we shall explore the complexities of specifying the duration of an animation using CSS, a crucial proficiency that can augment the caliber of website animation.

animation-duration Property

The CSS property known as animation-duration is utilized to establish the length of time required for an animation to complete a single cycle. It designates the time frame of an animation in seconds (s) or milliseconds (ms). The default setting for the animation-duration property is 0s, indicating that the animation transpires instantaneously and has no duration. When a value is assigned to the animation-duration property, the animation persists for the allotted duration before halting or restarting, based on the animation-iteration-count property.

Syntax

animation-duration: <time>;

登錄后復制

在這個上下文中,<time> 表示動畫的時間跨度,以秒(s)或毫秒(ms)為單位。數量可以是分數或整數。

Approach

在CSS中定義動畫的持續時間,請按照以下步驟:

    使用@keyframes規則定義動畫。該規則指定動畫的起始點和結束點。

    使用animation-name屬性將動畫應用于元素。此屬性將動畫鏈接到元素。

    通過使用animation-duration屬性來指示動畫的持續時間。此屬性確定了動畫完成其序列所需的時間量。

    Optionally, set the number of times the animation should repeat using the animation-iteration-count property. This property controls how many times the animation should play before stopping.

    Example

    The following HTML code segment above delineates the span of an animation in CSS. Firstly, the @keyframes decree explicates an animation that alters the backdrop color of an entity from red to yellow. The starting and ending points of the animation are designated by the from and to expressions in the @keyframes regulation. Here, the animation starts with a red background and culminates with a yellow background. Then, the div component is adorned with CSS attributes. The width and height attributes fix the size of the div entity, and the background-color property specifies the beginning background color as red. The animation-name attribute associates the animation laid out in the @keyframes regulation to the div entity. The animation-duration attribute determines the duration of the animation in seconds. In this instance, the animation will be two seconds long. Lastly, the animation-iteration-count attribute is set to an infinite value to generate an incessant animation loop until the user interacts with the webpage.

    <!DOCTYPE html>
    <html>
       <head>
          <title>How to define the duration of an animation takes to complete in CSS?</title>
          <style>
             @keyframes example {
                from {
                   background-color: red;
                }
                to {
                   background-color: yellow;
                }
             }
             div {
                width: 100px;
                height: 100px;
                background-color: red;
                animation-name: example;
                animation-duration: 2s;
                animation-iteration-count: infinite;
             }
          </style>
       </head>
       <body>
          <h4>How to define the duration of an animation takes to complete in CSS?</h4>
          <div></div>
       </body>
    </html>
    

    登錄后復制

    Conclusion

    總之,在CSS中確定動畫的特定時間范圍的過程需要細致的關注和深思熟慮。各種因素的交匯,如動畫的復雜性和用戶的參與度,決定了最佳持續時間。因此,設計師們要非常重視這些微妙之處,并明智地應用到他們的作品中。通過這樣做,他們可以確保他們的動畫不僅以其視覺魅力令人著迷,而且以其無可挑剔的執行而受到喜愛。

    以上就是如何在CSS中定義動畫完成的持續時間?的詳細內容,更多請關注www.92cms.cn其它相關文章!

分享到:
標簽:CSS 動畫 如何在 定義 持續時間
用戶無頭像

網友整理

注冊時間:

網站:5 個   小程序:0 個  文章:12 篇

  • 51998

    網站

  • 12

    小程序

  • 1030137

    文章

  • 747

    會員

趕快注冊賬號,推廣您的網站吧!
最新入駐小程序

數獨大挑戰2018-06-03

數獨一種數學游戲,玩家需要根據9

答題星2018-06-03

您可以通過答題星輕松地創建試卷

全階人生考試2018-06-03

各種考試題,題庫,初中,高中,大學四六

運動步數有氧達人2018-06-03

記錄運動步數,積累氧氣值。還可偷

每日養生app2018-06-03

每日養生,天天健康

體育訓練成績評定2018-06-03

通用課目體育訓練成績評定