CSS border-top 속성
예시
다른 요소의 상단 테두리 스타일을 설정합니다.
h1 {
border-top: 5px solid red;
}
h2 {
border-top: 4px dotted blue;
}
div {
border-top: double;
}
정의 및 사용
border-top
약식 속성은 하나의 선언에서 모든 위쪽 테두리 속성을 설정합니다 .
설정할 수 있는 속성은 다음과 같은 순서로 되어 있어야 합니다.
- 테두리 상단 너비
- 테두리 상단 스타일 (필수)
- 테두리 상단 색상
border-top-color를 생략하면 적용된 색상이 텍스트의 색상이 됩니다.
기본값: | 중간 색상 없음 |
---|---|
상속: | 아니요 |
애니메이션 가능: | 예, 개별 속성을 참조하십시오 . 애니메이션 가능 에 대해 읽기 |
버전: | CSS1 |
자바스크립트 구문: | object .style.borderTop="3px 파란색 파선" |
브라우저 지원
표의 숫자는 속성을 완전히 지원하는 첫 번째 브라우저 버전을 지정합니다.
Property | |||||
---|---|---|---|---|---|
border-top | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
CSS 구문
border-top: border-width border-style border-color|initial|inherit;
속성 값
Value | Description |
---|---|
border-top-width | Required. Specifies the width of the top border. Default value is "medium" |
border-top-style | Required. Specifies the style of the top border. Default value is "none" |
border-top-color | Optional. Specifies the color of the top 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 테두리
HTML DOM 참조: borderTop 속성