CSS选择器

1:plate 元素选择器
2:bento 元素选择器
3:#fancy ID选择器
4:plate apple 后代元素选择器
5:#fancy pickle 复合选择器
6:.small 类选择器
7:bento .small,plate .small 并集选择器
8:bento orange 后代元素选择器
9:plate,bento,plate 并集选择器
10:* 通配选择器
11:plate * 后代元素选择器
12:plate +apple 兄弟元素选择器
13:bento~pickle 兄弟元素选择器
14:plate > apple 子元素选择器
15:orange:first-child 子元素选择器
16::only-child 子元素选择器
17:.small:last-child 子元素选择器
18:plate:nth-child(3) 子元素选择器
19::nth-last-child(4)子元素选择器
20:apple:first-of-type子元素选择器
21:plate:nth-of-type(even)子元素选择器
22:plate:nth-of-type(2n+3)子元素选择器
23:apple:only-of-type子元素选择器
24:.small:nth-child(even)子元素选择器
25:bento:empty子元素选择器
26:apple:not(.small)not选择器

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 1.什么是选择器: 在CSS中,选择器是一种模式,用于选择需要添加样式的元素 2.选择器的种类和形式: $ 元素/...
    会说话的乌鸦阅读 1,073评论 0 0
  • id重温 •1. #占位符,以后跳转到哪里不确定,所以在herf后面加了#,但是如果不加‘herf’,就会没链...
    YU不忘初心阅读 671评论 0 0
  • 简单的选择器使用 1,元素选择器 元素选择器(标签选择器),可以根据标 签的名字来从页面中选取指定的元素。 语法:...
    策_54d3阅读 342评论 0 0
  • 1、选择器: *选择器(selector),会告诉浏览器:网页 上的哪些元素需要设置什么样的样式。 *比如:p这个...
    dream_seeker阅读 435评论 0 0
  • 阳春三月,春风又绿了梅江两岸,在这春意盎然、生机勃勃的日子里,听着鸟语,闻着花香,晨起暮落,看着路边树叶飘...
    慕南茜阅读 381评论 2 1