CSS 유형 선택자는 노드 이름을 사용해 요소를 선택합니다. 즉 문서 내에서 주어진 유형의 모든 요소를 선택합니다.

구문

element { style properties }

예제

CSS

span {
  background-color: DodgerBlue;
  color: #ffffff;
}

HTML

<span>텍스트를 가진 span입니다.</span>
<p>텍스트를 가진 p입니다.</p>
<span>또 다시 텍스트를 가진 span입니다.</span>

결과

명세

Specification Status Comment
Selectors Level 4
The definition of 'Type (tag name) selector' in that specification.
Working Draft No change
Selectors Level 3
The definition of 'type selectors' in that specification.
Recommendation No change
CSS Level 2 (Revision 1)
The definition of 'type selectors' in that specification.
Recommendation  
CSS Level 1
The definition of 'type selectors' in that specification.
Recommendation Initial definition

브라우저 호환성

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Type selector (elementName)Chrome Full support 1Edge Full support 12Firefox Full support 1IE Full support 3Opera Full support YesSafari Full support 1WebView Android Full support YesChrome Android Full support 18Firefox Android Full support 4Opera Android Full support YesSafari iOS Full support 1Samsung Internet Android Full support 1.0
Namespaces (ns|elementName)Chrome Full support 1Edge Full support 12Firefox Full support 1IE Full support 9Opera Full support 8Safari Full support 1.3WebView Android Full support YesChrome Android Full support 18Firefox Android Full support 4Opera Android Full support 10.1Safari iOS Full support 1Samsung Internet Android Full support 1.0

Legend

Full support  
Full support

문서 태그 및 공헌자

이 페이지의 공헌자: mdnwebdocs-bot, alattalatta, pelly_ryu
최종 변경자: mdnwebdocs-bot,