aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/xpath/comparison_with_css_selectors/index.html
diff options
context:
space:
mode:
authorFlorian Merz <me@fiji-flo.de>2021-02-11 12:56:40 +0100
committerFlorian Merz <me@fiji-flo.de>2021-02-11 12:56:40 +0100
commit310fd066e91f454b990372ffa30e803cc8120975 (patch)
treed5d900deb656a5da18e0b60d00f0db73f3a2e88e /files/zh-cn/web/xpath/comparison_with_css_selectors/index.html
parent8260a606c143e6b55a467edf017a56bdcd6cba7e (diff)
downloadtranslated-content-310fd066e91f454b990372ffa30e803cc8120975.tar.gz
translated-content-310fd066e91f454b990372ffa30e803cc8120975.tar.bz2
translated-content-310fd066e91f454b990372ffa30e803cc8120975.zip
unslug zh-cn: move
Diffstat (limited to 'files/zh-cn/web/xpath/comparison_with_css_selectors/index.html')
-rw-r--r--files/zh-cn/web/xpath/comparison_with_css_selectors/index.html43
1 files changed, 43 insertions, 0 deletions
diff --git a/files/zh-cn/web/xpath/comparison_with_css_selectors/index.html b/files/zh-cn/web/xpath/comparison_with_css_selectors/index.html
new file mode 100644
index 0000000000..c196e077e6
--- /dev/null
+++ b/files/zh-cn/web/xpath/comparison_with_css_selectors/index.html
@@ -0,0 +1,43 @@
+---
+title: Comparison of CSS Selectors and XPath
+slug: Web/CSS/CSS_Selectors/Comparison_with_XPath
+translation_of: Web/XPath/Comparison_with_CSS_selectors
+---
+<div>{{CSSRef("Selectors")}}{{QuickLinksWithSubpages("/en-US/docs/Web/XPath")}}{{Draft}}</div>
+
+<p class="summary">本文旨在记录CSS选择器和XPath之间的区别,以便Web开发人员能够更好地为正确的工作选择合适的工具。</p>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col"><a href="/en-US/docs/Web/XPath">XPath feature</a></th>
+ <th scope="col"><a href="/en-US/docs/Web/CSS/CSS_Selectors">CSS equivalent</a></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td><a href="/en-US/docs/Web/XPath/Axes/ancestor"><code>ancestor</code></a>, <a href="/en-US/docs/Web/XPath/Axes/parent"><code>parent</code></a> or <a href="/en-US/docs/Web/XPath/Axes/preceding-sibling"><code>preceding-sibling</code></a> axis</td>
+ <td>{{CSSxRef(":has",":has()")}} selector {{experimental_inline}}</td>
+ </tr>
+ <tr>
+ <td><a href="/en-US/docs/Web/XPath/Axes/ancestor"><code>attribute</code></a> axis</td>
+ <td><a href="/en-US/docs/Web/CSS/Attribute_selectors">Attribute selectors</a></td>
+ </tr>
+ <tr>
+ <td><a href="/en-US/docs/Web/XPath/Axes/child"><code>child</code></a> axis</td>
+ <td><a href="/en-US/docs/Web/CSS/Child_selectors">Child combinator</a></td>
+ </tr>
+ <tr>
+ <td><a href="/en-US/docs/Web/XPath/Axes/descendant"><code>descendant</code></a> axis</td>
+ <td><a href="/en-US/docs/Web/CSS/Descendant_selectors">Descendant combinator</a></td>
+ </tr>
+ <tr>
+ <td><a href="/en-US/docs/Web/XPath/Axes/following-sibling"><code>following-sibling</code></a> axis</td>
+ <td><a href="/en-US/docs/Web/CSS/General_sibling_selectors">General sibling combinator</a> or <a href="/en-US/docs/Web/CSS/Adjacent_sibling_selectors">adjacent sibling combinator</a></td>
+ </tr>
+ <tr>
+ <td><a href="/en-US/docs/Web/XPath/Axes/self"><code>self</code></a> axis</td>
+ <td>{{CSSxRef(":scope")}} or {{CSSxRef(":host")}} selector</td>
+ </tr>
+ </tbody>
+</table>