diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/css/transform-function/scalex() | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-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/scalex()')
-rw-r--r-- | files/zh-cn/web/css/transform-function/scalex()/index.html | 109 |
1 files changed, 109 insertions, 0 deletions
diff --git a/files/zh-cn/web/css/transform-function/scalex()/index.html b/files/zh-cn/web/css/transform-function/scalex()/index.html new file mode 100644 index 0000000000..c5a34d3e40 --- /dev/null +++ b/files/zh-cn/web/css/transform-function/scalex()/index.html @@ -0,0 +1,109 @@ +--- +title: scaleX() +slug: Web/CSS/transform-function/scaleX() +tags: + - axial symmetry + - scaleX() + - scaleX(-1) +translation_of: Web/CSS/transform-function/scaleX() +--- +<div>{{CSSRef}}</div> + +<p><strong><code>scaleX()</code></strong> CSS 函数将每个元素点的横坐标修改为一个常数因子,除了该比例因子为1,在这种情况下,函数是身份变换。 缩放不是各向同性的,并且元素的角度不保守。</p> + +<p><img src="https://mdn.mozillademos.org/files/12117/scaleX.png" style="height: 315px; width: 372px;"></p> + +<p><code>scaleX(sx)</code> 是 <code>scale(sx, 1)</code> 或 <code>scale3d(sx, 1, 1) </code>的一个速记/缩写。</p> + +<div class="note"> +<p>Note:</p> + +<p><strong><code>scaleX(-1)</code> </strong>定义一个 <a class="external" href="http://en.wikipedia.org/wiki/Axial_symmetry">轴向对称性(axial symmetry)</a> ,它具有一个垂直轴通过原点 (由 {{cssxref("transform-origin")}} 属性规定)。</p> +</div> + +<h2 id="Syntax">Syntax</h2> + +<pre class="syntaxbox">scaleX(<em>s</em>) +</pre> + +<h2 id="Values">Values</h2> + +<dl> + <dt><em>s</em></dt> + <dd>Is a {{cssxref("<number>")}} representing the scaling factor to apply on the abscissa 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><mtd>s</mtd><mtd>0</mtd></mtr> <mtr><mtd>0</mtd><mtd>1</mtd></mtr> </mtable> </mfenced> </math></td> + <td><math> <mfenced><mtable><mtr>s<mtd>0</mtd><mtd>0</mtd></mtr><mtr>0<mtd>1</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>s<mtd>0</mtd><mtd>0</mtd></mtr><mtr>0<mtd>1</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>s<mtd>0</mtd><mtd>0</mtd><mtd>0</mtd></mtr><mtr>0<mtd>1</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>[s 0 0 1 0 0]</code></td> + </tr> + </tbody> +</table> + +<h2 id="Examples">Examples</h2> + +<h3 id="Without_changing_the_origin">Without changing the origin</h3> + +<h4 id="HTML">HTML</h4> + +<pre class="brush: html"><p>foo</p> +<p class="transformed">bar</p></pre> + +<h4 id="CSS">CSS</h4> + +<pre class="brush: css">p { + width: 50px; + height: 50px; + background-color: teal; +} + +.transformed { + transform: scaleX(2); + background-color: blue; +} +</pre> + +<h4 id="Result">Result</h4> + +<p>{{EmbedLiveSample("Without_changing_the_origin","100%","200")}}</p> + +<h3 id="Translating_the_origin_of_the_transformation">Translating the origin of the transformation</h3> + +<h4 id="HTML_2">HTML</h4> + +<pre class="brush: html"><p>foo</p> +<p class="transformed">bar</p></pre> + +<h4 id="CSS_2">CSS</h4> + +<pre class="brush: css">p { + width: 50px; + height: 50px; + background-color: teal; +} + +.transformed { + transform: scaleX(2); + transform-origin: left; + background-color: blue; +} +</pre> + +<h4 id="Result_2">Result</h4> + +<p>{{EmbedLiveSample("Translating_the_origin_of_the_transformation","100%","200")}}</p> |