CSS 테두리 속성
예시
다른 요소의 테두리 스타일을 설정합니다.
h1 {
border: 5px solid red;
}
h2 {
border: 4px dotted blue;
}
div {
border:
double;
}
정의 및 사용
속성은 다음 border
에 대한 약식 속성입니다.
border-color를 생략하면 적용된 색상이 텍스트의 색상이 됩니다.
기본값: | 중간 색상 없음 |
---|---|
상속: | 아니요 |
애니메이션 가능: | 예, 개별 속성을 참조하십시오 . 애니메이션 가능 에 대해 읽기 |
버전: | CSS1 |
자바스크립트 구문: | object .style.border="3px 단색 파란색" |
브라우저 지원
표의 숫자는 속성을 완전히 지원하는 첫 번째 브라우저 버전을 지정합니다.
Property | |||||
---|---|---|---|---|---|
border | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
CSS 구문
border: border-width border-style border-color|initial|inherit;
속성 값
Value | Description |
---|---|
border-width | Specifies the width of the border. Default value is "medium" |
border-style | Specifies the style of the border. Default value is "none" |
border-color | Specifies the color of the border. Default value is the color of the text |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
관련 페이지
CSS 튜토리얼: CSS 테두리
CSS 튜토리얼: CSS 상자 모델
HTML DOM 참조: 테두리 속성