CSS 유형 선택자는 노드 이름을 사용해 요소를 선택합니다. 즉 문서 내에서 주어진 유형의 모든 요소를 선택합니다.
/* All <a> elements. */
a {
color: red;
}
구문
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 |
브라우저 호환성
BCD tables only load in the browser
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.