css选择器

引入外部css:<head> <link rel="stylesheet" type="text/css" href="mystyle.css"> </head>

ID:#id

CLASS:.class

p.class p标签使用.class类的元素。

背景:background

当使用简写属性时,属性值的顺序为::

  • background-color
  • background-image
  • background-repeat
  • background-attachment
  • background-position

div p:后代选取器(以空格分隔)

div>p:子元素选择器(以大于号分隔)

div+p:相邻兄弟选择器(以加号分隔)

div~p:普通兄弟选择器(以波浪号分隔)

p:first-child:第一个子类选择器

CSS伪类:

https://www.w3cschool.cn/css/css-pseudo-classes.html

原文地址:https://www.cnblogs.com/swordyt/p/7676598.html