CSS选择符:

  id选择器(#myid)、

  类选择器(.myclassname)、

  标签选择器(div, h1, p)、

  相邻选择器(h1 + p)、

  子选择器(ul > li)、

  后代选择器(li a)、

  通配符选择器(*)、

  属性选择器(a[rel=”external”])、

  伪类选择器(a:hover, li:nth-child)

 

可继承的属性:font-size, font-family, color

不可继承的样式:border, padding, margin, width, height

 

优先级(就近原则):!important > [ id > class > tag ]
!important 比内联优先级高

相关文章:

  • 2021-12-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-11
  • 2022-01-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案