From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/css/box-orient/index.html | 99 +++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 files/zh-cn/web/css/box-orient/index.html (limited to 'files/zh-cn/web/css/box-orient/index.html') diff --git a/files/zh-cn/web/css/box-orient/index.html b/files/zh-cn/web/css/box-orient/index.html new file mode 100644 index 0000000000..33f8d38a72 --- /dev/null +++ b/files/zh-cn/web/css/box-orient/index.html @@ -0,0 +1,99 @@ +--- +title: box-orient +slug: Web/CSS/box-orient +translation_of: Web/CSS/box-orient +--- +
{{CSSRef}}{{Non-standard_header}} +

这是原始的css弹性布局草案的一个属性,已经被最新的标准替代。 查看 flexbox 了解现行标准。

+
+ +

box-orient CSS 属性用来设置一个元素是水平还是垂直布局其内容。

+ +
/* Keyword values */
+box-orient: horizontal;
+box-orient: vertical;
+box-orient: inline-axis;
+box-orient: block-axis;
+
+/* Global values */
+box-orient: inherit;
+box-orient: initial;
+box-orient: unset;
+
+ +

语法

+ +

box-orient 属性值需指定为以下关键字之一。

+ +

+ +
+
horizontal
+
盒子水平布局其内容。
+
vertical
+
盒子垂直布局其内容。
+
inline-axis (HTML)
+
盒子沿内联轴展示其子元素。
+
block-axis (HTML)
+
盒子沿块轴展示其子元素。
+
+ +

内联轴和块轴取决于写入模式的关键字,在英语中,分别对应水平和垂直方向。

+ +

规范

+ +

{{CSSInfo}}

+ +

正式语法

+ +
{{CSSSyntax}}
+ +

示例

+ +

设置盒子水平布局

+ +

在这里,box-orient 属性会将两个 {{HTMLElement("p")}} 段落布局到同一行。

+ +

HTML

+ +
<div class="example">
+  <p>I will be to the left of my sibling.</p>
+  <p>I will be to the right of my sibling.</p>
+</div>
+ +

CSS

+ +
div.example {
+  display: -moz-box;                /* Mozilla */
+  display: -webkit-box;             /* WebKit */
+  display: box;                     /* As specified */
+
+  /* Children should be oriented vertically */
+  -moz-box-orient: horizontal;      /* Mozilla */
+  -webkit-box-orient: horizontal;   /* WebKit */
+  box-orient: horizontal;           /* As specified */
+}
+
+ +

结果

+ +

{{ EmbedLiveSample('Examples', 600, 50, '', 'Web/CSS/box-orient') }}

+ +

规范

+ +

不是任何标准的一部分。

+ +

浏览器兼容性

+ + + +

{{Compat("css.properties.box-orient")}}

+ +

参见

+ + -- cgit v1.2.3-54-g00ecf