css黑科技currentColor当前颜色return.icon{显示:内联块;宽度:16px;高度:20px;背景图像:url(http:jartto.wang/test.png);背景颜色:currentColor;/*这个颜色控制图标的颜色*/background-position:00;}.link:hover{color:#333;/*虽然改变了文字的颜色,但是图标的颜色也改变了*/}vh、vw、vmin、vmax是浏览器视口的宽高分成100份,1vh相当于浏览器高度的百分之一,即浏览器高度为800px,则1vh=8px。vw宽度相同。vh和vw支持calc算法。box{height:calc(100vh-50px);}h1{font-size:8vw;}vmin和vmax与宽高的最大值或最小值有关,具体取决于哪个是越来越大越来越小。例如,如果浏览器设置为1100px宽和700px高,则1vmin将为7px,1vmax将为11px。但是,如果宽度设置为800px,高度设置为1080px,则1vmin将等于8px,1vmax将等于10.8px。.box{height:calc(100vmax-50px);}多种边框颜色.box{border-style:solid;border-color:redgreenbluepink;}border-style必须设置才有效css绘制小箭头Border和transparent属性实现/*arrowup*/.arrow-up{width:0;高度:0;border-left:30pxsolidtransparent;border-right:30pxsolidtransparent;border-bottom:30pxsolid#fff;}/*向下箭头*/.arrow-down{width:0;高度:0;border-left:20pxsolidtransparent;border-right:20pxsolidtransparent;border-top:20pxsolid#0066cc;}图片滤镜效果使用filter属性可以实现多种图片效果,包括以下属性:grayscale,sepia,brown,saturate,saturation,hue-rotate,invert,invert,opacity,透明度,亮度,对比度,对比度,模糊,模糊,阴影,浏览器滚动条美化(只支持webkit内核浏览器)/*scrollbarstart*/::-webkit-scrollbar{width:1px;高度:4px;background-color:#F5F5F5;}/*定义滚动条轨道内阴影+圆角*/::-webkit-scrollbar-track{box-shadow:inset006pxrgba(0,0,0,0.3);background:#fff;}/*定义滑块内阴影+圆角*/::-webkit-scrollbar-thumb{border-radius:3px;框阴影:插入006pxrgba(0,0,0,.3);//背景颜色:rgba(7,170,247,0.7);背景色:透明;}::-webkit-scrollbar-thumb:hover{border-radius:3px;框阴影:插入006pxrgba(0,0,0,.3);background-color:rgba(7,170,247,1);}使用:not()在menu.navli:not(:last-child)上应用/取消应用边框{border-right:1pxsolid#666;}浏览器默认line-height一般是1.15倍,可以给body设置line-height:1来设置行高为1.0倍body{line-height:1;}usenegativenth-childselectitemusenegativenth-childincss选择项目1到项目nli{display:none;}li:nth-child(-n+3){display:block;}disablemouseevents.disabled{pointer-events:none;}