css小笔记

一、优先级

二、伪类

三、伪元素

  • ::first-line
  • ::first-letter
  • ::before
  • ::after
  • ::selection

伪元素共有5个,selection是css3新加的,表示选中的文字,css2伪元素和伪类是一样只有一个:而css3规定伪元素要用两个:

四、background-size值为cover和值为100%的区别

background-size:100% 100%; ---按容器比例撑满,图片变形;
background-size:cover;---把背景图片放大到适合元素容器的尺寸,图片比例不变。

 

五、渐变linear-gradient()

background: linear-gradient(0deg, #000 20%, #f00 50%, #090 80%);

第一个参数:用角度值指定渐变的方向(或角度),也可以用to left,to right,to top,to bottom,to left top,to right bottom,to right top,to left bottom代替。

第二个参数:颜色和渐变到元素的百分比。

六、一些强大的函数

七、选择器符号

八、属性选择器

九、@ 规则

十、css3滤镜

 十一、css变量

原文地址:https://www.cnblogs.com/amiezhang/p/7456638.html