스타일 borderLeft 속성
예시
<div> 요소에 왼쪽 테두리를 추가합니다.
document.getElementById("myDiv").style.borderLeft = "thick solid #0000FF";
정의 및 사용
borderLeft 속성은 약식 형식으로 최대 3개의 개별 border-left 속성을 설정하거나 반환합니다.
이 속성을 사용하여 다음 중 하나 이상을 설정/반환할 수 있습니다(순서에 관계없이):
- 테두리 왼쪽 너비
- 테두리 왼쪽 스타일
- 테두리 왼쪽 색상
브라우저 지원
borderLeft 속성은 모든 주요 브라우저에서 지원됩니다.
통사론
borderLeft 속성을 반환합니다.
object.style.borderLeft
borderLeft 속성을 설정합니다.
object.style.borderLeft = "width style color|initial|inherit"
속성 값
Parameter | Description |
---|---|
width | Sets the width of the left border |
style | Sets the style of the left border |
color | Sets the color of the left border |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
기술적 세부 사항
기본값: | 명시되지 않은 |
---|---|
반환 값: | 요소의 왼쪽 테두리의 너비, 스타일 및/또는 색상을 나타내는 문자열 |
CSS 버전 | CSS1 |
더 많은 예
예시
<div> 요소의 왼쪽 테두리 너비, 스타일 및 색상을 변경합니다.
document.getElementById("myDiv").style.borderLeft = "thin dotted red";
예시
<div> 요소의 border-left 속성 값을 반환합니다.
alert(document.getElementById("myDiv").style.borderLeft);
관련 페이지
CSS 튜토리얼: CSS 테두리
CSS 참조: border-left 속성
HTML DOM 참조: 테두리 속성