css3d转换_CSS转换:简介

css3d转换

Making elements look different under certain conditions has always been possible in CSS, initiated by simple pseudo-classes like :hover. CSS transforms, coupled with keyframe animations and transitions, simply extend this capability into movement.

CSS中 ,始终可以通过某些简单的伪类(:hover使元素在某些条件下看起来不同。 CSS变换与关键帧动画和过渡结合在一起,可以简单地将此功能扩展到移动中。

This ability runs up against traditional uses of JavaScript and Flash, and is beginning to supplement and replace both in these areas. As a result, JavaScript is slowly being shifted back to where it is most appropriate: in browser interaction and scripting, rather than appearance and effects.

此功能与JavaScript和Flash的传统用法背道而驰,并且已开始在这两个方面进行补充和替换。 结果,JavaScript正在缓慢地移回到最合适的位置:浏览器交互和脚本编写,而不是外观和效果。

Transforms are officially still in working draft status at the W3C. All modern browser versions use the established spec; Safari 8 (mobile and desktop), IE9 and Android 4.4.4 (and earlier) use vendor prefixes on the property. The base transformations are rotate, skew, scale and translate, with a matrix property to allow all four transformations to be implemented at once. In many ways, scale and translate are just handy alternatives to manipulating the properties left, top, right, bottom, width and height, but skew and rotate are completely new:

转换在W3C上仍处于工作草案状态。 所有现代浏览器版本均使用已建立的规范。 Safari 8(移动和台式机),IE9和Android 4.4.4(及更低版本)在属性上使用供应商前缀 。 基本转换是rotateskewscaletranslate ,具有matrix属性,以允许同时实施所有四个转换。 在许多方面, scaletranslate只是操纵属性lefttoprightbottomwidthheight方便替代方法,但是skewrotate是全新的:

By default, transforms take place from the computed centre of an element. In order to change this, you must alter the transform-origin property.

默认情况下,变换发生从一个元素的计算的中心 。 为了更改此设置,必须更改transform-origin属性。

To create a transformation, use the transform property and attach the transform you wish to use, with the appropriate values in parentheses:

要创建转换,请使用transform属性并使用括号中的适当值附加您要使用的转换:

body { transform: rotate(9deg); }

A new addition to the specification makes rotate, scale, translate and skew properties. That is, the mistake I constantly made when writing transforms for the first few years:

规范的新增加使rotatescaletranslateskew 属性成为可能 。 就是说,在最初的几年里,我不断犯的错误转变了:

body { rotate: 9deg; }

Will actually be valid CSS, and work in the browser. However, this addition is very new, and only the most beta of browser versions currently supports it. The code is not yet ready for prime-time, unless you are using a pre- or post-processor that will automatically translate this use of the spec into CSS that is compatible with current browsers.

实际上将是有效CSS,并且可以在浏览器中工作。 但是 ,此添加是非常新的,并且当前只有大多数beta版本的浏览器支持它。 该代码尚未准备就绪,除非您正在使用预处理器或后处理器,该处理器会自动将此规范的使用转换为与当前浏览器兼容CSS。

There are also 3D CSS transforms, which are the subject of an entire reading list.

还有3D CSS转换,它们是整个阅读列表的主题

翻译自: https://thenewcode.com/273/CSS-Transformations-Introduction

css3d转换

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值