Bitte warten...

2D-Transformationen

W3C-Empfehlung

Versatz – translate, translateX, translateY

Code kopieren
  1. <style>
  2. .translate {
  3. -webkit-transform:translate(10px, 10px);
  4. -ms-transform:translate(10px, 10px);
  5. transform:translate(10px, 10px);
  6. }
  7. </style>
  8. <div style='border:1px solid red;width:500px;margin:auto;'>
  9. <div class='translate' style='background-color:#555;padding:10px;'>
  10. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur <span class='translate'>sadipscing</span> elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
  11. </div>
  12. </div>
Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.

Skalierung – scale, scaleX, scaleY

Code kopieren
  1. <style>
  2. .scale {
  3. -webkit-transform:scale(1.2, .7);
  4. -ms-transform:scale(1.2, .7);
  5. transform:scale(1.2, .7);
  6. }
  7. </style>
  8. <div style='border:1px solid red;width:500px;margin:auto;'>
  9. <div class='scale' style='background-color:#555;padding:10px;'>
  10. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur <span class='scale'>sadipscing</span> elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
  11. </div>
  12. </div>
Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.

Neigung – skew, skewX, skewY

Code kopieren
  1. <style>
  2. .skew {
  3. -webkit-transform:skew(20deg, -5deg);
  4. -ms-transform:skew(20deg, -5deg);
  5. transform:skew(20deg, -5deg);
  6. }
  7. </style>
  8. <div style='border:1px solid red;width:500px;margin:auto;'>
  9. <div class='skew' style='background-color:#555;padding:10px;'>
  10. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur <span class='skew'>sadipscing</span> elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
  11. </div>
  12. </div>
Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.

Drehung – rotate

Code kopieren
  1. <style>
  2. .rotate {
  3. -webkit-transform:rotate(20deg);
  4. -ms-transform:rotate(20deg);
  5. transform:rotate(20deg);
  6. }
  7. </style>
  8. <div style='border:1px solid red;width:500px;margin:auto;'>
  9. <div class='rotate' style='background-color:#555;padding:10px;'>
  10. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur <span class='rotate'>sadipscing</span> elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
  11. </div>
  12. </div>
Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.

Ursprung der Transformation – transform-origin

Code kopieren
  1. <style>
  2. .origin {
  3. -webkit-transform:rotate(20deg);
  4. -ms-transform:rotate(20deg);
  5. transform:rotate(20deg);
  6. -webkit-transform-origin:top left;
  7. -ms-transform-origin:top left;
  8. transform-origin:top left;
  9. }
  10. </style>
  11. <div style='border:1px solid red;width:500px;margin:auto;'>
  12. <div class='origin' style='background-color:#555;padding:10px;'>
  13. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur <span class='rotate'>sadipscing</span> elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
  14. </div>
  15. </div>
Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.