update - CSS: Cascading Style Sheets 编辑
The update
CSS media feature can be used to test how frequently (if at all) the output device is able to modify the appearance of content.
Syntax
The update
feature is specified as a single keyword value chosen from the list below.
none
- Once it has been rendered, the layout can no longer be updated. Example: documents printed on paper.
slow
- The layout may change dynamically according to the usual rules of CSS, but the output device is not able to render or display changes quickly enough for them to be perceived as a smooth animation. Examples: e-book readers or severely underpowered devices.
fast
- The layout may change dynamically according to the usual rules of CSS, and the output device is not unusually constrained in speed, so regularly-updating things like CSS Animations can be used. Example: computer screens.
Examples
HTML
<p>If this text animates for you, you are using a fast-updating device.</p>
CSS
@keyframes jiggle {
from {
transform: translateY(0);
}
to {
transform: translateY(25px);
}
}
@media (update: fast) {
p {
animation: 1s jiggle linear alternate infinite;
}
}
Result
Specifications
Specification | Status | Comment |
---|---|---|
Media Queries Level 4 The definition of 'update' in that specification. | Candidate Recommendation | Initial definition. |
Browser compatibility
BCD tables only load in the browser
See also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论