自内向外 content,padding,border,margin. content表明 width; height.css
W3C默认: box-sizing: content-box . IE 默认: box-sizing: border-boxweb
行内元素能够用 text-align: center; 块级元素可使用 margin: 0 auto;flex
水平居中:3d
position:absolute +left:50%+ transform:translateX(-50%)orm
display:flex + justify-content: center事件
垂直居中:input
设置line-height 等于height, 不能写100%it
position:absolute +top:50%+ transform:translateY(-50%)io
display:flex + align-items: centerevent
css禁用鼠标事件:pointer-events: none;
css禁止用户选择: user-select: none; (可加各个内核渲染器识别)
隔行样式: nth-child(even/odd)
颜色渐变实现linear-gradient
让overflow:scroll平滑滚动 :-webkit-overflow-scrolling: touch; // 移动端
input:-webkit-autofill, textarea:-webkit-autofill, select:-webkit-autofill { background-color: rgb(250, 255, 189); /* #FAFFBD; */ background-image: none; color: rgb(0, 0, 0); }
当检测到某个DOM元素应用了某些CSS规则时就会自动开启
.css {
-webkit-transform: translate3d(0,0,0);
-moz-transform: translate3d(0,0,0);
-ms-transform: translate3d(0,0,0);
transform: translate3d(0,0,0);
}