CSS Properties
CSS border-block-end-style Property
Photo Credit to CodeToFun
🙋 Introduction
The border-block-end-style
property in CSS is used to define the style of the border on the block-end side of an element. In languages that are written top-to-bottom (like English), the block-end side corresponds to the bottom edge of the element.
This property is particularly useful in multi-directional layouts where the writing mode of text can vary. It provides a way to control the border style based on the logical flow of content rather than the physical layout.
💡 Syntax
The syntax for the border-block-end-style
property is simple:
element {
border-block-end-style: style;
}
Here, style refers to the type of border you want to apply, such as solid, dashed, dotted, etc.
🎛️ Default Value
The default value of the border-block-end-style
property is none, meaning no border is displayed by default.
🏠 Property Values
The border-block-end-style
property accepts the following values:
Value | Description |
---|---|
none | No border is displayed. |
solid | A single solid line. |
dashed | A series of dashed lines. |
dotted | A series of dotted lines. |
double | Two solid lines with some space between them. |
groove | A 3D grooved border that appears as though it is carved into the page. |
ridge | A 3D ridged border that appears as though it is coming out of the page. |
inset | A 3D inset border that makes the element appear embedded. |
outset | A 3D outset border that makes the element appear raised. |
hidden | The same as none, but it still affects table layout. |
📄 Example
In this example, we'll apply different styles to the block-end border of a div element.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSS border-block-end-style Example</title>
<style>
.solid-border {
border-block-end-style: solid;
border-block-end-width: 4px;
border-block-end-color: blue;
}
</style>
</head>
<body>
<h1>Block-End Border Style Example</h1>
<div class="solid-border">
This `div` element has a solid block-end border.
</div>
</body>
</html>
🖥️ Browser Compatibility
The border-block-end-style
property is supported in most modern browsers, including the latest versions of Chrome, Firefox, Safari, Edge, and Opera. As with any CSS property, it's a good idea to test your design across different browsers to ensure compatibility.
🎉 Conclusion
The border-block-end-style
property is a useful tool for controlling the appearance of the block-end border in your designs.
By using this property, you can create visually distinct elements that enhance the layout and design of your web pages, especially in multi-directional content flows. Experiment with different styles to find the look that best suits your design needs.
👨💻 Join our Community:
Author
For over eight years, I worked as a full-stack web developer. Now, I have chosen my profession as a full-time blogger at codetofun.com.
Buy me a coffee to make codetofun.com free for everyone.
Buy me a Coffee
If you have any doubts regarding this article (CSS border-block-end-style Property), please comment here. I will help you immediately.