Skip to content

Commit 7a609a2

Browse files
committed
Added example on how to apply 'transform-origin'.
1 parent da1248b commit 7a609a2

4 files changed

Lines changed: 107 additions & 0 deletions

File tree

css3-transforms/ChangeLog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2012-04-25 dschulze@adobe.com
2+
Added example on how to apply 'transform-origin'.
3+
14
2012-04-25 dschulze@adobe.com
25
Update "Status of this document" to use FX TF template.
36

css3-transforms/Overview.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,26 @@ <h2 id=transform-rendering><span class=secno>5. </span>The Transform
588588
src=transform1.png></div>
589589
</div>
590590

591+
<div class=example>
592+
<pre>div {
593+
height: 100px; width: 100px;
594+
transform-origin: 50px 50px;
595+
transform: rotate(45deg);
596+
}
597+
</pre>
598+
599+
<p>The &lsquo;<a href="#transform-origin"><code
600+
class=property>transform-origin</code></a>&rsquo; property moves the
601+
point of origin by 50 pixels in both the X and Y directions. The
602+
transform rotates the element clockwise by 45° about the point of
603+
origin. After all transform functions were applied, the translation of
604+
the origin gets translated back by -50 pixels in both the X and Y
605+
directions.</p>
606+
607+
<div class=figure><img alt="The point of origin gets translated temporary"
608+
height=250 src=origin1.svg width=735></div>
609+
</div>
610+
591611
<div class=example>
592612
<pre>
593613
div {

css3-transforms/Transforms.src.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,23 @@ <h2 id="transform-rendering">The Transform Rendering Model</h2>
292292
<img src="transform1.png" alt="The 100px translation in X and Y">
293293
</div>
294294
</div>
295+
296+
<div class="example">
297+
<pre>div {
298+
height: 100px; width: 100px;
299+
transform-origin: 50px 50px;
300+
transform: rotate(45deg);
301+
}
302+
</pre>
303+
304+
<p>The 'transform-origin' property moves the point of origin by 50 pixels in
305+
both the X and Y directions. The transform rotates the element
306+
clockwise by 45° about the point of origin. After all
307+
transform functions were applied, the translation of the origin gets
308+
translated back by -50 pixels in both the X and Y directions.</p>
309+
310+
<div class="figure"><img alt="The point of origin gets translated temporary" src="origin1.svg" width="735" height="250"></div>
311+
</div>
295312

296313
<div class="example">
297314
<pre>

css3-transforms/origin1.svg

Lines changed: 67 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)