CSS border-block property
Browser support · legacy reference
ChromeNot supported
SafariNot supported
FirefoxFully supports
Internet ExplorerNot supported
EdgeNot supported
OperaNot supported
Description
CSS border-block is a logical property that defines border width, style, and color for the start and end sides. The selection of start and end sides depends upon the writing-mode.
The start and end sides are top and bottom sides respectively for horizontal-tb writing-mode.
The start and end sides are left and right sides respectively for vertical-* writing-mode.
Change the direction of flow of text.
horizontal-tb vertical-lr vertical-rl
Syntax
border-block : border-block-width border-block-style border-block-color;
Property values
border-block-width
mediumDefault
-
medium value represents medium sized border. thin≤medium≤thick
- Try it
border-block-width: medium; +ve length
-
length defines the line width of border. The used units might be px, in, em, pt.
- Try it
border-block-width: 10px;
border-block-style
noneDefault
-
There is no style. In this case, the color and width of border are also ignored i.e. 0px border.
- Try it
border-block-style: none; hidden
-
It is same as 'none' but resolve to different results for the border-collapse property in tables.
- Try it
border-block-style: hidden; double
-
The border consists of two lines. The total border-block-width equals to the two lines and space between them.
- Try it
border-block-style: double; ridge
-
The content seems to be coming out of the canvas. It is obtained by producing the box-shadow from the two colors that are lighter and darker than the border-color.
The outer side of the bottom border is darker than the inner side of the bottom border.
- Try it
border-block-style: ridge; groove
-
The content seems to be going into the canvas. It is obtained by producing the box-shadow from the two colors that are lighter and darker than the border-color.
The inner side of the bottom border is darker than the outer side of the bottom border.
- Try it
border-block-style: groove;
border-color
currentColorDefault
-
currentColor keyword represents the same color for the border as of text color.
- Try it
border-block-color: currentColor; color-name
-
The following demo represents skyblue color for the border.
- Try it
border-block-color: skyblue; rgb value
-
It represents rgb value of a color.
The hexadecimal value of red color for the border is given below.
- Try it
border-block-color: rgb(255,0,0); hexadecimal value
-
It represents hexadecimal notation of red color.
The hexadecimal notation of blue color for the border is given below.
- Try it
border-block-color: #0000ff;
Applicable to
It applies to all elements