스타일 fontVariant 속성
예시
요소의 글꼴을 "작은 대문자"로 설정합니다.
document.getElementById("demo").style.fontVariant = "small-caps";
정의 및 사용
fontVariant 속성은 글꼴을 소문자로 표시할지 여부를 설정하거나 반환합니다.
즉, 모든 소문자는 대문자로 변환되지만 나머지 텍스트에 비해 글꼴 크기가 더 작아집니다.
브라우저 지원
Property | |||||
---|---|---|---|---|---|
fontVariant | Yes | Yes | Yes | Yes | Yes |
통사론
fontVariant 속성을 반환합니다.
object.style.fontVariant
fontVariant 속성을 설정합니다.
object.style.fontVariant = "normal|small-caps|initial|inherit"
속성 값
Value | Description |
---|---|
normal | The font is normal. This is default |
small-caps | The font is displayed in small capital letters |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
기술적 세부 사항
기본값: | 정상 |
---|---|
반환 값: | 일반 또는 소문자로 된 글꼴을 나타내는 문자열 |
CSS 버전 | CSS1 |
더 많은 예
예시
요소의 글꼴 변형을 반환합니다.
alert(document.getElementById("demo").style.fontVariant);
관련 페이지
CSS 튜토리얼: CSS 글꼴
CSS 참조: font-variant 속성
HTML DOM 참조: 글꼴 속성
❮ 스타일 개체