Language
日本語
English

Caution

JavaScript is disabled in your browser.
This site uses JavaScript for features such as search.
For the best experience, please enable JavaScript before browsing this site.

CSS Dictionary

  1. Home
  2. CSS Dictionary
  3. box-orient

box-orient

Used to specify the layout direction of child elements inside a flexible box. Since browser support is currently limited to webkit-based browsers, there may be few use cases. A flexible box is a flexible container where sizes and layouts can be specified relatively. Block-level elements such as those with 'display:block;' or regular 'div' elements can be turned into flexible boxes by specifying 'box' as the value of 'display'. As mentioned, since support is limited to webkit-based browsers and requires the vendor prefix 'webkit', you must specify '-webkit-box' when using it.

Sample Code

display:-webkit-box;

-webkit-box-orient:inline-axis; /* Child elements are displayed along the inline axis */
-webkit-box-orient:block-axis; /* Child elements are displayed along the block axis */
-webkit-box-orient:horizontal; /* Child elements are displayed horizontally from left to right */
-webkit-box-orient:vertical; /* Child elements are stacked vertically from top to bottom */
-webkit-box-orient:inherit; /* Inherits the value from the parent element */

Available Values

ValueDescription
inline-axisChild elements are displayed along the inline axis (initial value)
block-axisChild elements are displayed along the block axis (initial value)
horizontalChild elements are displayed horizontally from left to right
verticalChild elements are stacked vertically from top to bottom
inheritInherits the value from the parent element

Browser Preview

<div style="background:#FF0; display:-webkit-box; -webkit-box-orient:inline-axis; padding:5px;">
	<div style="background:#F00;">1st div element</div>
	<div style="background:#0F0;">2nd div element</div>
	<div style="background:#0FF;">3rd div element</div>
</div>

<div style="background:#FF0; display:-webkit-box; -webkit-box-orient:block-axis; padding:5px;">
	<div style="background:#F00;">1st div element</div>
	<div style="background:#0F0;">2nd div element</div>
	<div style="background:#0FF;">3rd div element</div>
</div>

<div style="background:#FF0; display:-webkit-box; -webkit-box-orient:horizontal; padding:5px;">
	<div style="background:#F00;">1st div element</div>
	<div style="background:#0F0;">2nd div element</div>
	<div style="background:#0FF;">3rd div element</div>
</div>

<div style="background:#FF0; display:-webkit-box; -webkit-box-orient:vertical; padding:5px;">
	<div style="background:#F00;">1st div element</div>
	<div style="background:#0F0;">2nd div element</div>
	<div style="background:#0FF;">3rd div element</div>
</div>

<div style="background:#FF0; display:-webkit-box; -webkit-box-orient:inherit; padding:5px;">
	<div style="background:#F00;">1st div element</div>
	<div style="background:#0F0;">2nd div element</div>
	<div style="background:#0FF;">3rd div element</div>
</div>

Browser Support

Chrome Chrome
Firefox Firefox
Safari Safari
Edge Edge
12+
Requires prefix '-webkit-'
IE IE
11 ×
10 ×
9 ×
8 ×
7 ×
6 ×
Opera Opera
14 and earlier ×
iOS Safari iOS Safari
Android Android Browser
3 and earlier ×
Chrome Android Chrome Android
Latest
Same support as desktop
Firefox Android Firefox Android
Latest
Same support as desktop

※ Version data based on MDN.

If you find any errors or copyright issues, please .