zoukankan      html  css  js  c++  java
  • CSS: transforms

    CSS 2D Transforms

    CSS Transforms

    CSS transforms allow you to translate, rotate, scale, and skew elements.

    A transformation is an effect that lets an element change shape, size and position.

    CSS supports 2D and 3D transformations.

    • translate()
    • rotate()
    • scale()
    • skewX()
    • skewY()
    • matrix()

    The translate() Method

    The translate() method moves an element from its current position (according to the parameters given for the X-axis and the Y-axis).

    The following example moves the <div> element 50 pixels to the right, and 100 pixels down from its current position:

    transform: translate(50px, 100px);

    The rotate() Method

    The rotate() method rotates an element clockwise or counter-clockwise according to a given degree.

    The following example rotates the <div> element clockwise with 20 degrees:

    transform: rotate(20deg);

    The scale() Method

    The scale() method increases or decreases the size of an element (according to the parameters given for the width and height).

    The following example increases the <div> element to be two times of its original width, and three times of its original height: 

      transform: scale(1.5, 2.5);
    
      transform: scale(0.5, 0.5);

    The skewX() skewY() skew()Method(倾斜)

    The skewX() method skews an element along the X-axis by the given angle.

    The following example skews the <div> element 20 degrees along the X-axis:

    transform: skewX(20deg);
    transform: skewY(20deg);
    transform: skew(20deg,30deg);

    The matrix() Method

    he matrix() method combines all the 2D transform methods into one.

    The matrix() method take six parameters, containing mathematic functions, which allows you to rotate, scale, move (translate), and skew elements.

    The parameters are as follow: matrix(scaleX(),skewY(),skewX(),scaleY(),translateX(),translateY())

     
    transform: matrix(1, -0.3, 0, 1, 0, 0);

     

  • 相关阅读:
    静态页转换平台(StaticPol)-静态页生成终极解决方案
    用DataSetSurrogate加速WebService
    压缩和解压缩数据流
    Stream 和 byte[] 之间的转换(转)
    优化网站性能 提高网站速度访问速度的14条实践(转)
    常用WebServices返回数据的4种方法比较
    .Net 中的序列化与反序列化
    对象序列化反序列化
    ASP.Net中自定义Http处理及应用之HttpModule篇
    利用UrlRewrite,asp.net动态生成htm页面
  • 原文地址:https://www.cnblogs.com/Nyan-Workflow-FC/p/10601266.html
Copyright © 2011-2022 走看看