Tillitsdone
down Scroll to discover
Understanding CSS border-inline-start-color for Web Design
Learn about the CSS border-inline-start-color property, which sets the color of the logical inline start border of an element.

This property adapts to different writing modes and directions, offering flexibility with named colors, hex codes, RGB, and HSL values.
thumbnail

Introduction

The border-inline-start-color CSS property defines the color of the logical inline start border of an element. This property is useful for web design and development because it adapts to different writing modes, directions, and text orientations. Introduced in September 2021, it’s widely supported across many browsers, making it a reliable choice for modern web development.

This property allows developers to set the border color at the logical start of an element’s border, which could be the border-top-color, border-right-color, border-bottom-color, or border-left-color depending on the writing mode, direction, and text orientation defined in the CSS. This flexibility ensures that the border color remains consistent and visually appealing regardless of the content’s layout.

Browser Compatibility

The border-inline-start-color CSS property is well-established and widely supported across many devices and browser versions. It has been available since September 2021, ensuring compatibility with a broad range of modern browsers.

For detailed compatibility information, refer to the comprehensive Browser Compatibility tables below. These tables outline the support for border-inline-start-color across different browsers and versions, helping you ensure that your web designs work seamlessly for all users.

  • Learn more about compatibility: ( WebsiteUrl )
  • Full compatibility details: #browser_compatibility
  • Report feedback: ( WebsiteUrl )

Description

The border-inline-start-color CSS property allows you to set the color of the logical inline start border of an element. Unlike traditional border properties, which are fixed to specific directions (top, right, bottom, left), this property adapts dynamically based on the element’s writing mode, directionality, and text orientation.

This property is particularly useful in creating responsive designs that support multiple languages and writing directions. For instance, in a left-to-right (LTR) text direction, border-inline-start-color will correspond to border-left-color. However, in a right-to-left (RTL) text direction, it will correspond to border-right-color. Similarly, in vertical writing modes, it will adjust to border-top-color or border-bottom-color accordingly.

By using border-inline-start-color, web developers can ensure that the border color remains consistent and visually coherent, regardless of the content’s layout or reading direction. This makes it an essential tool for designing accessible and internationalized websites.

Syntax

The syntax for border-inline-start-color is straightforward and allows for a variety of values, including color values and global CSS values.

border-inline-start-color: red;
border-inline-start-color: #ee4141;
/* Global values */
border-inline-start-color: inherit;
border-inline-start-color: initial;
border-inline-start-color: revert;
border-inline-start-color: revert-layer;
border-inline-start-color: unset;

Values

The border-inline-start-color property accepts the following values:

  • <color>: Specifies the color of the border. This can be any valid CSS color value, such as named colors (red, blue), hex codes (#ff0000), RGB values (rgb(255, 0, 0)), or HSL values (hsl(0, 100%, 50%)).

Formal Definition

The border-inline-start-color property has the following formal definition:

  • Initial Value: currentcolor
  • Applies To: All elements
  • Inherited: No
  • Computed Value: Computed color
  • Animation Type: By computed value type

Formal Syntax

border-inline-start-color = <color>

Examples

Here are some examples to illustrate how border-inline-start-color can be used in CSS:

HTML

<div>
<p class="exampleText">Example text</p>
</div>
<div class="horizontal-example">
<p>This is a horizontal example text.</p>
</div>
<div class="rtl-example">
<p>This is a right-to-left example text.</p>
</div>
<div class="complex-example">
<p>This is a complex example text.</p>
</div>

CSS

div {
background-color: yellow;
width: 120px;
height: 120px;
}
.exampleText {
writing-mode: vertical-lr;
border: 10px solid blue;
border-inline-start-color: red;
}
.horizontal-example {
background-color: lightblue;
width: 200px;
height: 100px;
padding: 10px;
}
.horizontal-example p {
writing-mode: horizontal-tb;
border: 5px solid black;
border-inline-start-color: green;
}
.rtl-example {
background-color: lightcoral;
width: 200px;
height: 100px;
padding: 10px;
}
.rtl-example p {
direction: rtl;
border: 5px solid black;
border-inline-start-color: purple;
}
.complex-example {
background-color: lightgreen;
width: 200px;
height: 100px;
padding: 10px;
}
.complex-example p {
writing-mode: vertical-lr;
border: 5px solid black;
border-inline-start-color: orange;
border-inline-end-color: blue;
border-block-start-color: red;
border-block-end-color: green;
}

Specifications

The border-inline-start-color property is defined in the CSS Logical Properties and Values Level 1 specification under the border-color section.

  • Specification: ( WebsiteUrl )

Related Properties

See Also

By understanding and utilizing the border-inline-start-color property, web developers can create more flexible and visually consistent designs that adapt to various writing modes and text directions.

Syntax

The syntax for the border-inline-start-color CSS property is simple and intuitive, allowing you to specify the color of the logical inline start border of an element. Here is how you can use it:

border-inline-start-color: red;
border-inline-start-color: #ee4141;
/* Global values */
border-inline-start-color: inherit;
border-inline-start-color: initial;
border-inline-start-color: revert;
border-inline-start-color: revert-layer;
border-inline-start-color: unset;

Explanation

  • Color Values: You can use any valid CSS color value to set the border color. This includes named colors (like red), hexadecimal values (like #ee4141), RGB values (like rgb(255, 0, 0)), and HSL values (like hsl(0, 100%, 50%)).
  • Global Values: These include inherit, initial, revert, revert-layer, and unset, which provide additional control over how the property is applied.

Usage in CSS

Here’s a basic example to illustrate how to use the border-inline-start-color property in your CSS:

.example {
border-inline-start-color: blue;
}

This example sets the logical inline start border color of the element with the class example to blue. The actual border that gets colored will depend on the writing mode, directionality, and text orientation of the element.

Complete Example

HTML

<div class="example">
<p>This is an example text.</p>
</div>

CSS

.example {
writing-mode: vertical-lr;
border: 5px solid black;
border-inline-start-color: blue;
background-color: lightgray;
padding: 20px;
}

In this example, the .example class sets the writing mode to vertical-lr, applies a 5px solid black border to all sides, and changes the start border color to blue. The background color and padding are added for better visualization.

By using the border-inline-start-color property correctly, you can ensure that your designs remain consistent and visually appealing across different writing modes and text directions, enhancing the overall user experience.

Values

The border-inline-start-color property in CSS accepts a variety of values that allow you to specify the color of the logical inline start border of an element. Here are the details of the accepted values:

<color>

This value specifies the color of the border. It can be any valid CSS color value, including:

  • Named Colors: Such as red, blue, green, etc.
  • Hexadecimal Colors: Such as #ff0000 (red), #00ff00 (green), etc.
  • RGB Colors: Such as rgb(255, 0, 0) (red), rgb(0, 255, 0) (green), etc.
  • HSL Colors: Such as hsl(0, 100%, 50%) (red), hsl(120, 100%, 50%) (green), etc.
  • RGBA Colors: Such as rgba(255, 0, 0, 0.5) (semi-transparent red).
  • HSLA Colors: Such as hsla(0, 100%, 50%, 0.5) (semi-transparent red).

Global Values

In addition to color values, the border-inline-start-color property also accepts global CSS values, which provide additional control over how the property is applied:

  • inherit: Inherits the value from the parent element.
  • initial: Sets the property to its initial value, which is currentcolor.
  • revert: Reverts the property to the value specified in the user-agent stylesheet.
  • revert-layer: Reverts the property to the value specified in the user-agent stylesheet, considering the cascade layer.
  • unset: Resets the property to its natural value, which means it behaves like inherit if the property is inherited, or like initial if it is not.

Examples

Here are some examples to illustrate how different values can be used with the border-inline-start-color property:

Using Named Colors

border-inline-start-color: red;

Using Hexadecimal Colors

border-inline-start-color: #ee4141;

Using RGB Colors

border-inline-start-color: rgb(255, 0, 0);

Using HSL Colors

border-inline-start-color: hsl(0, 100%, 50%);

Using Global Values

border-inline-start-color: inherit;
border-inline-start-color: initial;
border-inline-start-color: revert;
border-inline-start-color: revert-layer;
border-inline-start-color: unset;

By using these values, you can easily customize the border color of the logical inline start border to match the design requirements of your web project. This flexibility ensures that your designs remain visually consistent and adaptable to different writing modes and text directions.

Formal Definition

The border-inline-start-color CSS property has specific characteristics that define its behavior and usage. Here are the formal definitions for this property:

  • Initial Value: currentcolor
    • The initial value of border-inline-start-color is set to the element’s current color, ensuring consistency with the overall design.
  • Applies To: All elements
    • This property can be applied to any HTML element, providing flexibility in styling borders.
  • Inherited: No
    • The border-inline-start-color property is not inherited from the parent element. Each element must have its own value specified.
  • Computed Value: Computed color
    • The computed value of this property is a color value that is determined based on the specified value or the element’s current color.
  • Animation Type: By computed value type
    • The border-inline-start-color property can be animated, and the animation type is based on the computed value type, allowing for smooth transitions.

Formal Syntax

The formal syntax for the border-inline-start-color property is straightforward and includes support for color values:

border-inline-start-color = <color>

Where <color> can be any valid CSS color value, including named colors, hexadecimal values, RGB, RGBA, HSL, and HSLA values.

Detailed Syntax Breakdown

The formal syntax can be broken down further to include more complex color definitions, such as stripes and gradients, although these are less commonly used:

border-inline-start-color =
<color> |
<image-1D>
<image-1D> =
<stripes()>
<stripes()> =
stripes( <color-stripe># )
<color-stripe> =
<color> &&
[ <length-percentage> | <flex> ]?

Explanation of Syntax Components

  • <color>: Any valid CSS color value.
  • <image-1D>: Represents a one-dimensional image, which can be used to create more complex border effects like stripes.
  • <stripes()>: A function that generates a striped pattern.
  • <color-stripe>: Defines a single stripe within the pattern, combining a color and optional dimensions.
  • <length-percentage>: Represents a length or percentage value.
  • <flex>: Represents a flexible length value.

By understanding the formal definition and syntax of the border-inline-start-color property, web developers can effectively utilize this property to create dynamic and responsive web designs. This ensures that borders are visually consistent and adaptable to various writing modes and text directions, enhancing the overall user experience.

Examples

Here are some examples to illustrate how the border-inline-start-color property can be used in CSS to create visually consistent and adaptable designs.

Example 1: Basic Usage

In this example, we’ll set the logical inline start border color to red for a paragraph element. This will adapt based on the writing mode and directionality of the text.

HTML

<p class="exampleText">Example text</p>

CSS

.exampleText {
writing-mode: vertical-lr;
border: 10px solid blue;
border-inline-start-color: red;
}

Example 2: Using Hexadecimal Colors

HTML

<p class="exampleText">Example text</p>

CSS

.exampleText {
writing-mode: vertical-lr;
border: 10px solid blue;
border-inline-start-color: #ee4141;
}

Example 3: Using RGB Colors

HTML

<p class="exampleText">Example text</p>

CSS

.exampleText {
writing-mode: vertical-lr;
border: 10px solid blue;
border-inline-start-color: rgb(255, 0, 0);
}

Example 4: Using HSL Colors

HTML

<p class="exampleText">Example text</p>

CSS

.exampleText {
writing-mode: vertical-lr;
border: 10px solid blue;
border-inline-start-color: hsl(0, 100%, 50%);
}

Example 5: Using Global Values

HTML

<p class="exampleText">Example text</p>

CSS

.exampleText {
writing-mode: vertical-lr;
border: 10px solid blue;
border-inline-start-color: inherit;
}

In these examples, the border-inline-start-color property is used to set the start border color for the .exampleText element, which has a vertical writing mode. The border color adapts based on the specified value and the writing mode of the element.

By using the border-inline-start-color property correctly, you can ensure that your designs remain consistent and visually appealing across different writing modes and text directions, enhancing the overall user experience.

CSS border-inline-start-color Property

The border-inline-start-color CSS property sets the color of the start border based on the writing mode and text direction of an element. This property adapts to different writing modes, making it perfect for responsive designs.

Examples

HTML

<div>
<p class="exampleText">Example text</p>
</div>
<div class="horizontal-example">
<p>This is a horizontal example text.</p>
</div>
<div class="rtl-example">
<p>This is a right-to-left example text.</p>
</div>
<div class="complex-example">
<p>This is a complex example text.</p>
</div>

CSS

div {
background-color: yellow;
width: 120px;
height: 120px;
}
.exampleText {
writing-mode: vertical-lr;
border: 10px solid blue;
border-inline-start-color: red;
}
.horizontal-example {
background-color: lightblue;
width: 200px;
height: 100px;
padding: 10px;
}
.horizontal-example p {
writing-mode: horizontal-tb;
border: 5px solid black;
border-inline-start-color: green;
}
.rtl-example {
background-color: lightcoral;
width: 200px;
height: 100px;
padding: 10px;
}
.rtl-example p {
direction: rtl;
border: 5px solid black;
border-inline-start-color: purple;
}
.complex-example {
background-color: lightgreen;
width: 200px;
height: 100px;
padding: 10px;
}
.complex-example p {
writing-mode: vertical-lr;
border: 5px solid black;
border-inline-start-color: orange;
border-inline-end-color: blue;
border-block-start-color: red;
border-block-end-color: green;
}

Related Properties

  • border-block-start-color: Sets the color of the logical block start border.
  • border-block-end-color: Sets the color of the logical block end border.
  • border-inline-end-color: Sets the color of the logical inline end border.
  • border-top-color: Sets the color of the top border (does not adapt to writing modes).
  • border-right-color: Sets the color of the right border (does not adapt to writing modes).
  • border-bottom-color: Sets the color of the bottom border (does not adapt to writing modes).
  • border-left-color: Sets the color of the left border (does not adapt to writing modes).
  • writing-mode: Specifies the writing mode (horizontal-tb, vertical-rl, vertical-lr).
  • direction: Specifies the text direction (ltr, rtl).
  • text-orientation: Specifies the orientation of text within a line box (mixed, upright, sideways).

Learn More

By using the border-inline-start-color property and related properties, you can create adaptable and consistent web designs that work well with various writing modes and text directions.

Get in Touch
Thank you for your interest in Tillitsdone! Whether you have a question about our services, want to discuss a potential project, or simply want to say hello, we're here and ready to assist you.
We'll be right here with you every step of the way.
Contact Information
rick@tillitsdone.com+66824564755
Find All the Ways to Get in Touch with Tillitsdone - We're Just a Click, Call, or Message Away. We'll Be Right Here, Ready to Respond and Start a Conversation About Your Needs.
Address
9 Phahonyothin Rd, Khlong Nueng, Khlong Luang District, Pathum Thani, Bangkok Thailand
Visit Tillitsdone at Our Physical Location - We'd Love to Welcome You to Our Creative Space. We'll Be Right Here, Ready to Show You Around and Discuss Your Ideas in Person.
Social media
Connect with Tillitsdone on Various Social Platforms - Stay Updated and Engage with Our Latest Projects and Insights. We'll Be Right Here, Sharing Our Journey and Ready to Interact with You.
We anticipate your communication and look forward to discussing how we can contribute to your business's success.
We'll be here, prepared to commence this promising collaboration.
Frequently Asked Questions
Explore frequently asked questions about our products and services.
Whether you're curious about features, warranties, or shopping policies, we provide comprehensive answers to assist you.