aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/css/transform-function/scaley()/index.html
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/css/transform-function/scaley()/index.html
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/zh-cn/web/css/transform-function/scaley()/index.html')
-rw-r--r--files/zh-cn/web/css/transform-function/scaley()/index.html91
1 files changed, 91 insertions, 0 deletions
diff --git a/files/zh-cn/web/css/transform-function/scaley()/index.html b/files/zh-cn/web/css/transform-function/scaley()/index.html
new file mode 100644
index 0000000000..4c690dcbbe
--- /dev/null
+++ b/files/zh-cn/web/css/transform-function/scaley()/index.html
@@ -0,0 +1,91 @@
+---
+title: scaleY()
+slug: Web/CSS/transform-function/scaleY()
+tags:
+ - 'transform: rotateX(180deg);'
+ - 'transform: scaleY(-1);'
+translation_of: Web/CSS/transform-function/scaleY()
+---
+<div>{{CSSRef}}</div>
+
+<p>The <strong><code>scaleY()</code></strong> <a href="/en-US/docs/Web/CSS">CSS</a> function defines a transformation that resizes an element along the y-axis (vertically). Its result is a {{cssxref("&lt;transform-function&gt;")}} data type.</p>
+
+<p><img src="https://mdn.mozillademos.org/files/12119/scaleY.png" style="height: 381px; width: 365px;"></p>
+
+<p>It modifies the ordinate of each element point by a constant factor, except when the scale factor is 1, in which case the function is the identity transform. The scaling is not isotropic, and the angles of the element are not conserved. <code>scaleY(-1)</code> defines an <a class="external" href="http://en.wikipedia.org/wiki/Axial_symmetry">axial symmetry</a>, with a horizontal axis passing through the origin (as specified by the {{cssxref("transform-origin")}} property).</p>
+
+<div class="note">
+<p><strong>Note:</strong> <code>scaleY(sy)</code> is equivalent to <code><a href="/en-US/docs/Web/CSS/transform-function/scale">scale</a>(1, sy)</code> or <code><a href="/en-US/docs/Web/CSS/transform-function/scale3d">scale3d</a>(1, sy, 1)</code>.</p>
+
+<p><code>transform: rotateX(180deg);</code>  === <code>transform: scaleY(-1);</code></p>
+</div>
+
+<h2 id="Syntax">Syntax</h2>
+
+<pre class="syntaxbox notranslate">scaleY(s)
+</pre>
+
+<h3 id="Values">Values</h3>
+
+<dl>
+ <dt><code>s</code></dt>
+ <dd>Is a {{cssxref("&lt;number&gt;")}} representing the scaling factor to apply on the ordinate of each point of the element.</dd>
+</dl>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Cartesian coordinates on ℝ<sup>2</sup></th>
+ <th scope="col">Homogeneous coordinates on ℝℙ<sup>2</sup></th>
+ <th scope="col">Cartesian coordinates on ℝ<sup>3</sup></th>
+ <th scope="col">Homogeneous coordinates on ℝℙ<sup>3</sup></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td colspan="1" rowspan="2"><math> <mfenced><mtable><mtr>1<mtd>0</mtd></mtr> <mtr><mtd>0</mtd><mtd>s</mtd></mtr> </mtable> </mfenced> </math></td>
+ <td><math> <mfenced><mtable><mtr>1<mtd>0</mtd><mtd>0</mtd></mtr><mtr>0<mtd>s</mtd><mtd>0</mtd></mtr><mtr><mtd>0</mtd><mtd>0</mtd><mtd>1</mtd></mtr></mtable> </mfenced> </math></td>
+ <td colspan="1" rowspan="2"><math> <mfenced><mtable><mtr>1<mtd>0</mtd><mtd>0</mtd></mtr><mtr>0<mtd>s</mtd><mtd>0</mtd></mtr><mtr><mtd>0</mtd><mtd>0</mtd><mtd>1</mtd></mtr></mtable> </mfenced> </math></td>
+ <td colspan="1" rowspan="2"><math> <mfenced><mtable><mtr>1<mtd>0</mtd><mtd>0</mtd><mtd>0</mtd></mtr><mtr>0<mtd>s</mtd><mtd>0</mtd><mtd>0</mtd></mtr><mtr><mtd>0</mtd><mtd>0</mtd><mtd>1</mtd><mtd>0</mtd></mtr><mtr><mtd>0</mtd><mtd>0</mtd><mtd>0</mtd><mtd>1</mtd></mtr></mtable> </mfenced> </math></td>
+ </tr>
+ <tr>
+ <td><code>[1 0 0 s 0 0]</code></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Examples">Examples</h2>
+
+<h3 id="HTML">HTML</h3>
+
+<pre class="brush: html notranslate">&lt;div&gt;Normal&lt;/div&gt;
+&lt;div class="scaled"&gt;Scaled&lt;/div&gt;</pre>
+
+<h3 id="CSS">CSS</h3>
+
+<pre class="brush: css notranslate">div {
+ width: 80px;
+ height: 80px;
+ background-color: skyblue;
+}
+
+.scaled {
+ transform: scaleY(0.6);
+ background-color: pink;
+}
+</pre>
+
+<h3 id="Result">Result</h3>
+
+<p>{{EmbedLiveSample("Examples", 200, 200)}}</p>
+
+<h2 id="Browser_compatibility">Browser compatibility</h2>
+
+<p>Please see the <code><a href="/en-US/docs/Web/CSS/transform-function#Browser_compatibility">&lt;transform-function&gt;</a></code> data type for compatibility info.</p>
+
+<h2 id="See_also">See also</h2>
+
+<ul>
+ <li>{{cssxref("transform")}}</li>
+ <li>{{cssxref("&lt;transform-function&gt;")}}</li>
+</ul>