温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

css background-blend-mode属性介绍

发布时间:2020-05-14 14:26:16 来源:亿速云 阅读:197 作者:Leah 栏目:web开发

css中的background-blend-mode属性是用来干什么的?怎么用?今天小编就总结了一篇文章来详细阐释这两个问题,希望你能有所收获,一起来看看吧。

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

CSS background-blend-mode属性

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

语法:

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属性的使用示例

<!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('https://img.php.cn/upload/article/000/000/024/5c6a4428ea867709.png');
  background-blend-mode: color-dodge;
}
</style>
</head>
<body>
<div></div>
</body>
</html>

以上就是css中的background-blend-mode属性的详细内容,代码示例简单明了,如果在日常工作遇到此问题。通过这篇文章,希望你能有所收获,更多详情敬请关注亿速云行业资讯频道!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI