当前位置: 首页 > Web前端 > CSS

mix-blend-mode和background-blend-mode实现炫酷画面风格

时间:2023-03-31 13:01:55 CSS

在网上看到mix-blend-mode,它有相机的功能,可以实现更好的图片风格,想自己搞定,所以记录一下1.效果图2.Mix-blend-mode相关属性{混合混合模式:正常;//普通混合混合模式:乘法;//相乘mix-blend-mode:screen;//过滤颜色mix-blend-mode:overlay;//叠加mix-blend-mode:darken;//变暗mix-blend-mode:lighten;//变亮mix-blend-mode:color-dodge;//颜色变亮mix-blend-mode:color-burn;//颜色变暗mix-blend-mode:hard-light;//强光mix-blend-mode:soft-light;//柔光mix-blend-mode:difference;//区别mix-blend-mode:exclusion;//排除mix-blend-mode:hue;//色调混合混合模式:饱和度;//饱和度mix-blend-mode:color;//颜色混合混合模式:亮度;//亮度混合混合模式:初始;混合混合模式:继承;mix-blend-mode:unset;}3.添加mix-blend-modehtml文件到cssnormal--normalmultiply--叠加底部screen--过滤颜色overlay--覆盖option>darken--darkenlighten--lightencolor-dodge--颜色lighteningcolor-burn--颜色加深hard-light--强光soft-light--柔光difference--区别exclusion--排除hue--色调saturation--饱和度color--颜色luminosity--亮度

css样式.container{position:relative;边距:140px自动;宽度:120px;高度:120px;}.item{位置:绝对;顶部:0;左:0;宽度:100px;高度:100px;边界半径:50%;混合混合模式:正常;}.mode1{转换:翻译X(30%);背景:rgba(255,0,255,.8);}.mode2{transform:translateX(-30%);背景:rgba(0,255,255,.8);}.mode3{transform:translateY(-50%);背景:rgba(0,255,0,.8);}#select{位置:绝对;左:500px;top:100px;}4.使用background-blend-modecss文件.root{width:400px;高度:500px;边距:20px自动;背景:url(../images/22.jpg),url(https://user-images.githubusercontent.com/8554143/34369175-c14ae23e-eaf4-11e7-96f1-e146e5e5a96b.jpg);背景尺寸:封面;/*背景混合模式:变亮;*/}#root{位置:绝对;顶部:50px;左:50px;}ul{边距:0;填充:0;list-style:none;}/*下拉框包层*/#selectedItem{width:240px;cursor:pointer;}/*已选中的选项*/#promptText{position:relative;左填充:10px;宽度:230px;高度:30px;行高:30px;边框:1px实心#d3d3d3;边界半径:4px;背景:#ffF;颜色:#999;font-size:14px;}/*icon*/#arrows{position:absolute;顶部:0;右:0;宽度:30px;高度:30px;vertical-align:middle;}#arrows:focus{outline:none;}/*下拉选项包括图层*/.choiceDescription{position:absolute;显示:无;/*溢出:隐藏;*/margin-top:2px;宽度:240px;边框:1px实心#ccc;边界半径:4px;盒子阴影:01px6pxrgba(0,0,0,.1);background:#fff;}.show{display:block;}/*下拉选项*/.item{height:30px;行高:30px;左填充:10px;字体大小:15px;颜色:#666;}.item:hover,.active{颜色:#fff;背景:rgba(49,255,195,0.67);}html文件请选择您喜欢的文字normal--normalmultiply--multiplybottomscreen--屏幕overlay--overlaydarken--darkenlighten--brightencolor-dodge--颜色减淡color-burn--颜色加深hard-light--强光soft-light--柔光difference--区别exclusion--exclusionhue--huesaturation--饱和度color--颜色luminosity--亮度5.注意mix-blend-mode和background-blend-mode是兼容的,正在努力学习。如果对你的学习有帮助,请留下你的印记(点个赞^_^)-微信小程序购物车和父子组件超值后带省略号的行和多行文本及计算的注意事项