当前位置: 代码迷 >> 综合 >> css偶尔实用的技巧
  详细解决方案

css偶尔实用的技巧

热度:56   发布时间:2024-01-28 22:47:25.0

结构伪类选择器 : 选择指定范围的元素

:nth-of-type(2n) 等同于 :nth-child(odd)
:nth-of-type(2n+1) 等同于 :nth-child(even)

文字两端对齐

text-align-last: justify; 等同于 justify-content: space-between;

排除一些没必要的元素,比如面包屑的分隔符

/* 我爱死链式调用了,什么,这不是js? */ 
ul > li:not(:last-child)::after {content: ",";
}

 

  相关解决方案