id 在部分浏览器的 js 中会直接生成同名变量;
id 的唯一性,获取该 id 的 dom 时,会取同名 id 的前者;
id 层叠权重非常高,1000 个 class 也覆盖不了 id 的样式;
class 可以用空格给同个元素设置多个 class,id 用空格会让 id 失效;
id 可以和链接锚点一起玩耍。
[css] 写一个动画,向上匀速移动100px,向下以1.5倍速度移动200px,一直反复循环 .animation-block {width: 50px;height: 50px;background: red;margin-top: 200px;animation: up 1s linear, down 1.5s linear 1s;}keyframes up {0% {transform…