A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://developer.mozilla.org/zh-CN/docs/Web/API/CSSKeyframesRule/name below:

CSSKeyframesRule:name 属性 - Web API

CSSKeyframesRule:name 属性

Baseline Widely available

CSSKeyframeRule 接口的 name 属性用于获取和设置动画的名称,该名称被 animation-name 属性使用。

值

字符串。

示例

以下 CSS 包含一个关键帧 at 规则。这将是 document.styleSheets[0].cssRules 返回的第一个 CSSRule。 myRules[0] 返回一个 CSSKeyframesRule 对象,其 name 属性设置为 "slide-in"。

@keyframes slide-in {
  from {
    transform: translateX(0%);
  }

  to {
    transform: translateX(100%);
  }
}
let myRules = document.styleSheets[0].cssRules;
let keyframes = myRules[0]; // CSSKeyframesRule
console.log(keyframes.name); // "slide-in"
规范 浏览器兼容性

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4