[CSS Practice] CSS box-orient

Source: Internet
Author: User

Definition and usage

The Box-orient property specifies that the child elements of the box should be arranged horizontally or vertically.

Tip: child elements in the horizontal box are displayed from left to right, while the child elements of the vertical box are displayed from top to bottom. However, box-direction and Box-ordinal-group can change that order.

By default, HTML DOM elements place their contents along the inline axis. This CSS property will only work with CSS display values of box or HTML elements inline-box

Grammatical Box-orient:horizontal|vertical|inline-axis|block-axis|inherit;
value Description
Horizontal Arranges child elements from left to right in horizontal rows.
Vertical Arranges child elements vertically from top to bottom.
Inline-axis Arranges child elements along the inline axis (mapped to horizontal).
Block-axis Arranges child elements along the block axis (mapped to vertical).
Inherit The value of the Box-orient property should be inherited from the parent element.
 Example:
1 <!DOCTYPE HTML>2 <HTML>3   <Head>4     <title>CSS Box-orient Example</title>5     <style>6 Div.example{7 Display:-moz-box;                /*Mozilla*/8 Display:-webkit-box;             /*WebKit*/9 Display:Box;                     /*As specified*/Ten  One         /*children should be oriented vertically*/ A -moz-box-orient:Horizontal;      /*Mozilla*/ - -webkit-box-orient:Horizontal;   /*WebKit*/ - box-orient:Horizontal;           /*As specified*/ the       } -     </style> -   </Head> -   <Body> +     <Divclass= "Example"> -       <P>I'll be, the left of my sibling.</P> +       <P>I'll be to the right of my sibling.</P> A     </Div> at   </Body> - </HTML>
Effect
I'll be, the left of my sibling. I'll be, the left of my sibling. the box-orient

property will cause the above two sections in the P example to appear in the same row
Compatible
Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari
Basic Support (Yes) -webkit (Yes) -webkit (Yes) -moz[1] No Support (Yes) -webkit 1.1-khtml
3.0-webkit

[CSS practice] CSS box-orient

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.