border-left-color

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

border-left-color CSS 속성은 요소의 왼쪽 테두리 색상을 지정합니다. border-color 또는 border-left 단축 속성으로도 지정할 수 있습니다.

시도해 보기

border-left-color: red;
border-left-color: #32a1ce;
border-left-color: rgb(170, 50, 220, 0.6);
border-left-color: hsl(60, 90%, 50%, 0.8);
border-left-color: transparent;
<section class="default-example" id="default-example">
  <div class="transition-all" id="example-element">
    This is a box with a border around it.
  </div>
</section>
#example-element {
  background-color: #eee;
  color: #000;
  border: 0.75em solid;
  padding: 0.75em;
  width: 80%;
  height: 100px;
}

구문

css
/* <color> 값 */
border-left-color: red;
border-left-color: #ffbb00;
border-left-color: rgb(255, 0, 0);
border-left-color: hsla(100%, 50%, 25%, 0.75);
border-left-color: currentColor;
border-left-color: transparent;

/* 전역 값 */
border-left-color: inherit;
border-left-color: initial;
border-left-color: unset;

border-left-color 속성은 하나의 값을 사용해 지정합니다.

<color>

왼쪽 테두리의 색상.

형식 구문

border-left-color = 
<color> |
<image-1D>

<image-1D> =
<stripes()>

<stripes()> =
stripes( <color-stripe># )

<color-stripe> =
<color> &&
[ <length-percentage> | <flex> ]?

<length-percentage> =
<length> |
<percentage>

예제

테두리를 가진 간단한 상자

HTML

html
<div class="mybox">
  <p>
    This is a box with a border around it. Note which side of the box is
    <span class="redtext">red</span>.
  </p>
</div>

CSS

css
.mybox {
  border: solid 0.3em gold;
  border-left-color: red;
  width: auto;
}

.redtext {
  color: red;
}

결과

명세

Specification
CSS Backgrounds and Borders Module Level 3
# border-color
초기값currentcolor
적용대상all elements. It also applies to ::first-letter.
상속no
계산 값computed color
Animation typea color

브라우저 호환성

같이 보기