CSS border-inline Property
Example
Set the style, color and width of the borders for different elements in the inline direction:
h1 {
border-inline: 5px solid red;
}
h2 {
border-inline: 4px dotted blue;
}
div {
border-inline:
double;
}
Try it Yourself »
Definition and Usage
The border-inline
property is a shorthand property for these properties:
If values for color or width are omitted, default values will be used.
The CSS
border-inline
property is very similar to CSS property
border
, but the
border-inline
property is dependent on the inline direction.
Note: The related CSS properties
writing-mode
,
text-orientation
and
direction
define inline direction. This affects where the start and end of a line is and the result of the border-inline
property. For pages in English, inline direction is left to right and block direction is downward.
Default value: | medium none color |
---|---|
Inherited: | no |
Animatable: | yes, see individual properties. Read about animatable Try it |
Version: | CSS3 |
JavaScript syntax: | object.style.borderInline="dashed hotpink 10px" Try it |
Browser Support
The numbers in the table specify the first browser version that fully supports the property.
Property | |||||
---|---|---|---|---|---|
border-inline | 87.0 | 87.0 | 66.0 | 14.1 | 73.0 |
CSS Syntax
border-inline: border-inline-width border-inline-style border-inline-color |initial|inherit;
Property Values
Value | Description | Demo |
---|---|---|
border-inline-width | Specifies the width of the borders in the inline direction. Default value is "medium" | Demo ❯ |
border-inline-style | Specifies the style of the borders in the inline direction. Default value is "none" | Demo ❯ |
border-inline-color | Specifies the color of the borders in the inline direction. Default value is the color of the text | Demo ❯ |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
More Examples
With writing-mode property
The position of the borders at the start and end in the inline direction is affected by the writing-mode
property:
div {
writing-mode: vertical-rl;
border-inline: hotpink dashed 8px;
}
Try it Yourself »
Related Pages
CSS tutorial: CSS Border
CSS border property: CSS Border property
CSS border-inline-color property: CSS Border-inline-color property
CSS border-inline-style property: CSS Border-inline-style property
CSS border-inline-width property: CSS Border-inline-width property
CSS direction property: CSS Direction property
CSS text-orientation property: CSS Text-orientation property
CSS writing-mode property: CSS Writing-mode property