aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/glossary/main_axis/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/zh-cn/glossary/main_axis/index.html')
-rw-r--r--files/zh-cn/glossary/main_axis/index.html50
1 files changed, 50 insertions, 0 deletions
diff --git a/files/zh-cn/glossary/main_axis/index.html b/files/zh-cn/glossary/main_axis/index.html
new file mode 100644
index 0000000000..c3c8b91de1
--- /dev/null
+++ b/files/zh-cn/glossary/main_axis/index.html
@@ -0,0 +1,50 @@
+---
+title: 主轴
+slug: Glossary/主轴
+translation_of: Glossary/Main_Axis
+---
+<p>主轴是由弹性容器 {{glossary("flexbox")}} 中弹性方向 {{cssxref("flex-direction")}} 属性所定义的的。弹性方向 <code>flex-direction </code> 有4个可能的值,分别是:</p>
+
+<ul>
+ <li><code>row</code></li>
+ <li><code>row-reverse</code></li>
+ <li><code>column</code></li>
+ <li><code>column-reverse</code></li>
+</ul>
+
+<p>选择行 <code>row</code> 或者 <code>row-reverse</code> 反向行,那么主轴方向就会沿着行的走向。</p>
+
+<p><img alt="In this image the flex-direction is row which forms the main axis" src="https://mdn.mozillademos.org/files/15708/Basics1.png" style="display: block; height: 152px; margin: 0px auto; width: 522px;"></p>
+
+<p>选择列 <code>column</code> 或者反向列 <code>column-reverse</code> ,那么主轴就会从上至下沿着块的走向。</p>
+
+<p><img alt="" src="https://mdn.mozillademos.org/files/15709/Basics2.png" style="display: block; height: 227px; margin: 0px auto; width: 709px;"></p>
+
+<p>在主轴上,你可以用 <code>flex</code> 属性来增加可用空间,从而控制弹性元素的尺寸,你还可以用 <code>justify-content</code> 属性来控制元素周围的空间、间距。</p>
+
+<h2 id="学习更多">学习更多</h2>
+
+<h3 id="属性参考">属性参考</h3>
+
+<div class="index">
+<ul>
+ <li>{{cssxref("flex-basis")}}</li>
+ <li>{{cssxref("flex-direction")}}</li>
+ <li>{{cssxref("flex-grow")}}</li>
+ <li>{{cssxref("flex-shrink")}}</li>
+ <li>{{cssxref("justify-content")}}</li>
+ <li>{{cssxref("flex")}}</li>
+</ul>
+</div>
+
+<h3 id="拓展阅读">拓展阅读</h3>
+
+<ul>
+ <li>CSS 弹性容器指南: <em><a href="/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox">Basic Concepts of Flexbox</a></em></li>
+ <li>CSS 弹性容器指南: <em><a href="/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Aligning_Items_in_a_Flex_Container">Aligning items in a flex container</a></em></li>
+ <li>CSS 弹性容器指南: <em><a href="/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Controlling_Ratios_of_Flex_Items_Along_the_Main_Ax">Controlling Ratios of flex items along the main axis</a></em></li>
+</ul>
+
+<div id="gtx-trans" style="position: absolute; left: 188px; top: 1222.14px;">
+<div class="gtx-trans-icon"></div>
+</div>