box-orient property

Image Tutorials

Definition and Usage

The box-orient property specifies whether the children of a box should be laid out horizontally or vertically.

Note: Children within a horizontal box are displayed from left to right, and children within a vertical box are displayed top to bottom. However, the box-direction and box-ordinal-group properties can change this ordering.

Default value: inline-axis
Inherited: no
Version: CSS3
JavaScript syntax: object.style.boxOrient=”vertical”

Syntax

box-orient: horizontal|vertical|inline-axis|block-axis|inherit;

Values

Value Description
horizontal Lay out children from left to right in a horizontal line
vertical Lay out children from top to bottom vertically
inline-axis Lay out children along the inline axis (map to horizontal)
block-axis Lay out children along the block axis (map to vertical)
inherit The value of the box-orient property should be inherited from the parent element

Examples

01 div {
02     width:350px;
03     height:100px;
04     border:1px solid black;
05     /* Firefox */
06     display:-moz-box;
07     -moz-box-orient:horizontal;
08     /* Safari, Opera, and Chrome */
09     display:-webkit-box;
10     -webkit-box-orient:horizontal;
11     /* W3C */
12     display:box;
13     box-orient:horizontal;
14 }

Rate article