* 怎么让一个元素 上下左右居中 (3种)
1. display: flex; // 设置 flex 必须要设置父元素
justify-content: center; // x 轴居中
align-items: center; // y 轴居中
2. position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
margin:auto
3. margin-left: -50%;
margin-top: -50%;
tranform: translate(-50%, -50%)
position 属性有 absolute relative sticky fixed
* css3 有哪些新特性:
transfrom, transition, animation, border-radius, box-shadow, flex,
will-change, ::before, ::after, columns
* css3 新增伪类
::after, ::before, :disabled, :focus, :checked :root, :nth-child
* css3 动画:
1. transform: translate(移动) rotate(旋转) scale(缩放)
translate(x, y) 移动
translateX(x)
translateY(y)
translate3D(x, y, z) 使用这个, 因为有伪GPU加速