CSS选择器

选择器语法规则如下所示:

选择器 用法
id选择器 #myid
类选择器 .myclassname
标签选择器 div,h1,p
相邻选择器 h1+p
子选择器 ul > li
后代选择器 li a
通配符选择器 *
属性选择器 a[rel="external"]
伪类选择器

a:hover, li:nth-child

参考链接:

https://www.w3cschool.cn/css/css-selector.html

posted @ 2021-05-03 14:35  胸怀丶若谷  阅读(43)  评论(0编辑  收藏  举报