유형 선택자
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
CSS 유형 선택자는 노드 이름을 사용해 요소를 선택합니다. 즉 문서 내에서 주어진 유형의 모든 요소를 선택합니다.
css
/* All <a> elements. */
a {
color: red;
}
구문
element { style properties }
예제
CSS
css
span {
background-color: DodgerBlue;
color: #ffffff;
}
HTML
html
<span>텍스트를 가진 span입니다.</span>
<p>텍스트를 가진 p입니다.</p>
<span>또 다시 텍스트를 가진 span입니다.</span>
결과
명세
Specification |
---|
Selectors Level 4 # type-selectors |
브라우저 호환성
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Type selector ( elementName ) | ||||||||||||
Namespaces ( ns|elementName ) |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
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.