博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
css选择器除了第一个_:第一个孩子(CSS选择器)
阅读量:2505 次
发布时间:2019-05-11

本文共 1002 字,大约阅读时间需要 3 分钟。

css选择器除了第一个

描述 (Description)

This pseudo-class matches an element only if it’s the first child element of its parent element. For instance, li:first-child matches the first list item in an ol or ul element. It doesn’t match the first child of a list item.

仅当该伪类是其父元素的第一个子元素时,它才与该元素匹配。 例如,li:first-child匹配ol或ul元素中的第一个列表项。 它与列表项的第一个子项不匹配。

For example, let’s take the CSS selector mentioned above:

例如,让我们使用上面提到CSS选择器:

li:first-child {  ⋮ declarations}

And let’s apply it to the following markup:

并将其应用于以下标记:

  • This item matches the selector li:first-child.
  • This item does not match that selector.
  • Neither does this one.

Only the first list item element is matched.

仅第一个列表项元素被匹配。

Note that this pseudo-class only applies to elements—it doesn’t apply to anonymous boxes generated for text.

请注意,此伪类仅适用于元素,不适用于为文本生成的匿名框。

(Example)

This example selector matches the first list item in an ol or ul element:

此示例选择器匹配olul元素中的第一个列表项:

li:first-child {  ⋮ declarations}

翻译自:

css选择器除了第一个

转载地址:http://obrgb.baihongyu.com/

你可能感兴趣的文章
工作中常见问题
查看>>
JAVA 从一个List里删除包含另一个List的数据
查看>>
外国的月亮比较圆吗?外籍团队工作有感
查看>>
分布式系统事务一致性解决方案
查看>>
ShuffleNet总结
查看>>
前后台验证字符串长度
查看>>
《算法导论 - 思考题》7-1 Hoare划分的正确性
查看>>
win64 Python下安装PIL出错解决2.7版本 (3.6版本可以使用)
查看>>
获取各种类型的节点
查看>>
表达式求值-201308081712.txt
查看>>
centos中安装tomcat6
查看>>
从Vue.js窥探前端行业
查看>>
学习进度
查看>>
poj3368 RMQ
查看>>
“此人不存在”
查看>>
github.com加速节点
查看>>
解密zend-PHP凤凰源码程序
查看>>
python3 序列分片记录
查看>>
Atitit.git的存储结构and 追踪
查看>>
atitit 读书与获取知识资料的attilax的总结.docx
查看>>