This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

유형 선택자

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨2015년 7월⁩.

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

브라우저 호환성