diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/css/_colon_last-child | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/web/css/_colon_last-child')
-rw-r--r-- | files/zh-cn/web/css/_colon_last-child/index.html | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/files/zh-cn/web/css/_colon_last-child/index.html b/files/zh-cn/web/css/_colon_last-child/index.html new file mode 100644 index 0000000000..e4720413c3 --- /dev/null +++ b/files/zh-cn/web/css/_colon_last-child/index.html @@ -0,0 +1,71 @@ +--- +title: ':last-child' +slug: 'Web/CSS/:last-child' +translation_of: 'Web/CSS/:last-child' +--- +<div>{{CSSRef}}</div> + +<h2 id="概述">概述</h2> + +<p><code>:last-child</code> CSS <a href="/en-US/docs/Web/CSS/Pseudo-classes">伪类</a> 代表父元素的最后一个子元素。</p> + +<h2 id="语法">语法</h2> + +<pre class="syntaxbox">{{csssyntax}}</pre> + +<h2 id="示例">示例</h2> + +<h3 id="HTML_内容">HTML 内容</h3> + +<pre class="brush: html"><ul> + <li>此元素背景色不是lime</li> + <li>我的也不是lime。</li> + <li>我的才是lime! :)</li> +</ul></pre> + +<h3 id="CSS_内容">CSS 内容</h3> + +<pre class="brush: css">li:last-child { + background-color: lime; +}</pre> + +<p>{{EmbedLiveSample('%E7%A4%BA%E4%BE%8B', '100%', 100)}}</p> + +<h2 id="规范">规范</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', '#last-child', ':last-child')}}</td> + <td>{{Spec2('CSS4 Selectors')}}</td> + <td>No change</td> + </tr> + <tr> + <td>{{SpecName('CSS3 Selectors', '#last-child', ':last-child')}}</td> + <td>{{Spec2('CSS3 Selectors')}}</td> + <td>Initial definition</td> + </tr> + </tbody> +</table> + +<h2 id="浏览器支持">浏览器支持</h2> + + +<div class="hidden">The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out <a class="external" href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</div> + +<p>{{Compat("css.selectors.last-child")}}</p> + +<h2 id="相关链接">相关链接</h2> + +<ul> + <li>{{cssxref(":first-child")}}</li> + <li>{{cssxref(":nth-child")}}</li> + <li>{{cssxref(":last-of-type")}}</li> +</ul> |