border-left-color
border-left-color
CSS 속성은 요소의 왼쪽 테두리 색상을 지정합니다. border-color
또는 border-left
단축 속성으로도 지정할 수 있습니다.
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
구문
/* <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>
- 왼쪽 테두리의 색상.
형식 구문
<color>where
<color> = <rgb()> | (en-US) <rgba()> | (en-US) <hsl()> | (en-US) <hsla()> | (en-US) <hex-color> | (en-US) <named-color> | (en-US) currentcolor | (en-US) <deprecated-system-color>
where
<rgb()> = rgb( <percentage>{ (en-US)3} (en-US) [ (en-US) / <alpha-value> ] (en-US)? (en-US) ) | (en-US) rgb( <number>{ (en-US)3} (en-US) [ (en-US) / <alpha-value> ] (en-US)? (en-US) ) | (en-US) rgb( <percentage># (en-US){ (en-US)3} (en-US) , <alpha-value>? (en-US) ) | (en-US) rgb( <number># (en-US){ (en-US)3} (en-US) , <alpha-value>? (en-US) )
<rgba()> = rgba( <percentage>{ (en-US)3} (en-US) [ (en-US) / <alpha-value> ] (en-US)? (en-US) ) | (en-US) rgba( <number>{ (en-US)3} (en-US) [ (en-US) / <alpha-value> ] (en-US)? (en-US) ) | (en-US) rgba( <percentage># (en-US){ (en-US)3} (en-US) , <alpha-value>? (en-US) ) | (en-US) rgba( <number># (en-US){ (en-US)3} (en-US) , <alpha-value>? (en-US) )
<hsl()> = hsl( <hue> <percentage> <percentage> [ (en-US) / <alpha-value> ] (en-US)? (en-US) ) | (en-US) hsl( <hue>, <percentage>, <percentage>, <alpha-value>? (en-US) )
<hsla()> = hsla( <hue> <percentage> <percentage> [ (en-US) / <alpha-value> ] (en-US)? (en-US) ) | (en-US) hsla( <hue>, <percentage>, <percentage>, <alpha-value>? (en-US) )where
<alpha-value> = <number> | (en-US) <percentage>
<hue> = <number> | (en-US) <angle>
예제
테두리를 가진 간단한 상자
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
.mybox {
border: solid 0.3em gold;
border-left-color: red;
width: auto;
}
.redtext {
color: red;
}
결과
명세
Specification | Status | Comment |
---|---|---|
CSS Backgrounds and Borders Module Level 3 The definition of 'border-left-color' in that specification. |
Candidate Recommendation | No significant changes, though the transparent keyword, now included in <color> which has been extended, has been formally removed. |
CSS Level 2 (Revision 1) The definition of 'border-left-color' in that specification. |
Recommendation | Initial definition |
초기값 | currentcolor |
---|---|
적용대상 | all elements. It also applies to ::first-letter (en-US). |
상속 | no |
Computed value | computed color |
Animation type | a color |
브라우저 호환성
BCD tables only load in the browser
같이 보기
- 테두리 관련 CSS 단축 속성:
border
,border-left
,border-color
. - 다른 방향 테두리의 색상 관련 CSS 단축 속성:
border-top-color
,border-right-color
,border-bottom-color
. - 왼쪽 테두리 관련 CSS 속성:
border-left-style
,border-left-width
.