{"id":350993,"date":"2021-09-02T07:41:56","date_gmt":"2021-09-02T14:41:56","guid":{"rendered":"https:\/\/css-tricks.com\/?page_id=350993"},"modified":"2021-09-17T08:43:33","modified_gmt":"2021-09-17T15:43:33","slug":"border-inline","status":"publish","type":"page","link":"https:\/\/css-tricks.com\/almanac\/properties\/b\/border-inline\/","title":{"rendered":"border-inline"},"content":{"rendered":"\n

border-inline<\/code> is a CSS logical<\/a> shorthand property that combines border-inline-color<\/code>, border-inline-style<\/code>, and border-inline-width<\/code> into a single declaration, styling an element’s borders in the inline (left and right) direction.<\/p>\n\n\n\n

.element {\n  border-inline: 5px solid red;\n  writing-mode: horizontal-tb;\n}<\/code><\/pre>\n\n\n\n

border-inline<\/code> is the logical equivalent to physical properties including border-left<\/code> and border-right<\/code> (or border-top<\/code> and border-bottom<\/code>, depending on the writing-mode<\/a><\/code>). It is defined in the CSS Logical Properties and Values Level 1 specification<\/a> which is in Editor\u2019s Draft at the time of this writing. The property is also the companion to border-block<\/a><\/code>, which styles borders that flow in the block (top and bottom) direction.<\/p>\n\n\n\n

\"Two
border-inline<\/code> styles the borders in the inline direction, left and right, of an element by default, but it adapts to borders in the block direction, top and bottom, when switching the writing-mode<\/code>.<\/figcaption><\/figure>\n\n\n\n

The writing-mode<\/code> defaults to horizontal top-to-bottom if it is not explicitly declared.<\/p>\n\n\n

The writing mode sets the direction<\/h3>\n\n\n

The direction of the borders depends on the writing-mode<\/code> property. When the writing mode is set to the default horizontal direction, border-inline<\/code> is applied to the left and right borders of an element. Conversely, a vertical writing-mode<\/code>, applies border-inline<\/code> to the top and bottom borders.<\/p>\n\n\n\n