aboutsummaryrefslogtreecommitdiff
path: root/files/ko/web/css/universal_selectors/index.html
blob: 3987c92504fb96982af39ebc5cea7ddccf5f5e0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
---
title: 전체 선택자
slug: Web/CSS/Universal_selectors
tags:
  - CSS
  - Reference
  - Selectors
translation_of: Web/CSS/Universal_selectors
---
<div>{{CSSRef("Selectors")}}</div>

<p><a href="/ko/docs/Web/CSS">CSS</a> <strong>전체 선택자</strong>(<code>*</code>)는 모든 형태의 모든 요소를 선택합니다.</p>

<pre class="brush: css notranslate">/* Selects all elements */
* {
  color: green;
}
</pre>

<p>CSS 3부터는 별표를 {{cssxref("CSS_Namespaces", "네임스페이스")}}와 함께 사용할 수 있습니다.</p>

<ul>
 <li><code>ns|*</code> - 네임스페이스 ns 안의 모든 요소 선택</li>
 <li><code>*|*</code> - 모든 요소 선택</li>
 <li><code>|*</code> - 네임스페이스 없는 모든 요소 선택</li>
</ul>

<h2 id="구문">구문</h2>

<pre class="syntaxbox notranslate">* { <em>style properties</em> }</pre>

<p>단순 선택자에서 별표는 선택사항입니다. 즉 <code>*.warning</code><code>.warning</code>은 같습니다.</p>

<h2 id="예제">예제</h2>

<h3 id="CSS">CSS</h3>

<pre class="brush: css notranslate">* [lang^=en] {
  color: green;
}

*.warning {
  color: red;
}

*#maincontent {
  border: 1px solid blue;
}

.floating {
  float: left
}

/* automatically clear the next sibling after a floating element */
.floating + * {
  clear: left;
}</pre>

<h3 id="HTML">HTML</h3>

<pre class="brush: html notranslate">&lt;p class="warning"&gt;
  &lt;span lang="en-us"&gt;A green span&lt;/span&gt; in a red paragraph.
&lt;/p&gt;
&lt;p id="maincontent" lang="en-gb"&gt;
  &lt;span class="warning"&gt;A red span&lt;/span&gt; in a green paragraph.
&lt;/p&gt;</pre>

<h3 id="결과">결과</h3>

<p>{{EmbedLiveSample('예제')}}</p>

<h2 id="명세">명세</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">명세</th>
   <th scope="col">상태</th>
   <th scope="col">설명</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('CSS4 Selectors', '#the-universal-selector', 'universal selector')}}</td>
   <td>{{Spec2('CSS4 Selectors')}}</td>
   <td>변화 없음</td>
  </tr>
  <tr>
   <td>{{SpecName('CSS3 Selectors', '#universal-selector', 'universal selector')}}</td>
   <td>{{Spec2('CSS3 Selectors')}}</td>
   <td>네임스페이스에 관한 행동이 정의되고 선택자 생략이 가상 요소 내에서 허용된다는 힌트가 추가됨</td>
  </tr>
  <tr>
   <td>{{SpecName('CSS2.1', 'selector.html#universal-selector', 'universal selector')}}</td>
   <td>{{Spec2('CSS2.1')}}</td>
   <td>초기 정의</td>
  </tr>
 </tbody>
</table>

<h2 id="브라우저_호환성">브라우저 호환성</h2>



<p>{{Compat("css.selectors.universal")}}</p>