aboutsummaryrefslogtreecommitdiff
path: root/files/zh-tw/web/css/descendant_combinator/index.html
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:43:23 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:43:23 -0500
commit218934fa2ed1c702a6d3923d2aa2cc6b43c48684 (patch)
treea9ef8ac1e1b8fe4207b6d64d3841bfb8990b6fd0 /files/zh-tw/web/css/descendant_combinator/index.html
parent074785cea106179cb3305637055ab0a009ca74f2 (diff)
downloadtranslated-content-218934fa2ed1c702a6d3923d2aa2cc6b43c48684.tar.gz
translated-content-218934fa2ed1c702a6d3923d2aa2cc6b43c48684.tar.bz2
translated-content-218934fa2ed1c702a6d3923d2aa2cc6b43c48684.zip
initial commit
Diffstat (limited to 'files/zh-tw/web/css/descendant_combinator/index.html')
-rw-r--r--files/zh-tw/web/css/descendant_combinator/index.html121
1 files changed, 121 insertions, 0 deletions
diff --git a/files/zh-tw/web/css/descendant_combinator/index.html b/files/zh-tw/web/css/descendant_combinator/index.html
new file mode 100644
index 0000000000..6fe82cfc8d
--- /dev/null
+++ b/files/zh-tw/web/css/descendant_combinator/index.html
@@ -0,0 +1,121 @@
+---
+title: 後裔選擇器
+slug: Web/CSS/Descendant_combinator
+tags:
+ - CSS
+ - CSS參考
+ - Selectors
+ - 初學者
+ - 選擇器
+translation_of: Web/CSS/Descendant_combinator
+---
+<p><span class="s1">{{CSSRef("Selectors")}}</span></p>
+
+<h2 id="Summary" name="Summary">簡介</h2>
+
+<p><code>␣</code> 組合符號 (代表空白, 或更精準地說,代表一或多個空白字元) 結合了兩種選擇器,選擇了只有當第二個選擇器的目標為第一個選擇器目標的後裔時的元素,後裔選擇器跟<a href="/en/CSS/Child_selectors" title="en/CSS/Child selectors">子選擇器</a>相似,但是不要求披對的元素要是嚴格是父子關係。</p>
+
+<h2 id="Syntax" name="Syntax">語法</h2>
+
+<pre class="eval">selector1 selector2 { <em>style properties</em> }
+</pre>
+
+<h2 id="Example" name="Example">範例</h2>
+
+<pre class="brush: css">span { background-color: white; }
+div span { background-color: DodgerBlue; }
+</pre>
+
+<pre class="brush: html">&lt;div&gt;
+ &lt;span&gt;Span 1.
+ &lt;span&gt;Span 2.&lt;/span&gt;
+ &lt;/span&gt;
+&lt;/div&gt;
+&lt;span&gt;Span 3.&lt;/span&gt;
+</pre>
+
+<p>{{ EmbedLiveSample('Example', 200, 50) }}</p>
+
+<h2 id="Specifications">Specifications</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{ SpecName('CSS4 Selectors', '#descendant-combinators', 'descendant combinator') }}</td>
+ <td>{{ Spec2('CSS4 Selectors') }}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{ SpecName('CSS3 Selectors', '#descendant-combinators', 'descendant combinator') }}</td>
+ <td>{{ Spec2('CSS3 Selectors') }}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{ SpecName('CSS2.1', 'selector.html#descendant-selectors', 'descendant selectors') }}</td>
+ <td>{{ Spec2('CSS2.1') }}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{ SpecName('CSS1', '#contextual-selectors', 'contextual selectors') }}</td>
+ <td>{{ Spec2('CSS1') }}</td>
+ <td>Initial definition</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility">Browser compatibility</h2>
+
+<p>{{ CompatibilityTable() }}</p>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ </tr>
+ </tbody>
+</table>
+</div>