CSS background-blend-mode属性怎么用?


本文摘自PHP中文网,作者青灯夜游,侵删。

CSS background-blend-mode属性用于定义背景层的混合模式,其语法是“background-blend-mode: normal|multiply|screen|overlay|darken|lighten...”。

推荐:《css教程》

background-blend-mode属性用于定义背景层的混合模式(图片与颜色),可设置的模式有:正片叠底模式、滤色模式、叠加模式、变暗模式、变亮模式、颜色减淡模式、饱和度模式、颜色模式、亮度模式。

CSS background-blend-mode属性

作用:用于定义了背景层的混合模式(图片与颜色)

语法:

1

background-blend-mode: normal|multiply|screen|overlay|darken|lighten|color-dodge|saturation|color|luminosity;

属性值:

normal:默认值,设置正常的混合模式。

multiply :正片叠底模式。

screen:滤色模式。

overlay:叠加模式。

darken:变暗模式。

lighten:变亮模式。

color-dodge:颜色减淡模式。

saturation:饱和度模式。

color:颜色模式。

luminosity:亮度模式。

注: Internet Explorer 不支持 background-blend-mode 属性。

CSS background-blend-mode属性的使用示例

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

<style>

body  {background-color: yellow;}

div {

  width: 290px;

  height: 69px;

  background-size: 290px 69px;

  background-repeat:no-repeat;

  background-image: linear-gradient(to right, #25a1b1 50%,#862e3e 100%), url('http://ypimg.muzhuangnet.com/Collect/csharp/upload/article/000/000/024/5c6a4428ea867709.png');

  background-blend-mode: color-dodge;

}

</style>

</head>

<body>

<div></div>

</body>

</html>

效果图:

2.jpg

以上就是本篇文章的全部内容,希望能对大家的学习有所帮助。

以上就是CSS background-blend-mode属性怎么用?的详细内容,更多文章请关注木庄网络博客

相关阅读 >>

css top属性怎么用

关于css中定位的总结

css如何设置占位隐藏

怎么让css文件里图片居中

html+css+javascript如何实现列表循环滚动

html怎么让文字在图片表面

css如何实现下划线滑动效果

了解css中容易被忽略特性,避免一些经常遇到的坑

常见的css框架有哪些

css如何设置文字超出省略号

更多相关阅读请进入《background-blend-mode》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...