Skip to content

background-blend-mode

background-blend-mode 属性定义元素背景的混合模式。

语法

css
background-blend-mode: normal | multiply | screen | overlay | darken | lighten | color-dodge | color-burn | hard-light | soft-light | difference | exclusion | hue | saturation | color | luminosity;

常见值

说明示例
normal正常background-blend-mode: normal
multiply乘法background-blend-mode: multiply
screen屏幕background-blend-mode: screen
overlay叠加background-blend-mode: overlay
darken变暗background-blend-mode: darken
lighten变亮background-blend-mode: lighten
color-dodge颜色减淡background-blend-mode: color-dodge
color-burn颜色加深background-blend-mode: color-burn
hard-light强光background-blend-mode: hard-light
soft-light柔光background-blend-mode: soft-light
difference差异background-blend-mode: difference
exclusion排除background-blend-mode: exclusion
hue色相background-blend-mode: hue
saturation饱和度background-blend-mode: saturation
color颜色background-blend-mode: color
luminosity亮度background-blend-mode: luminosity

示例

基础用法

css
/* 正常 */
.normal {
  background-blend-mode: normal;
}

/* 乘法 */
.multiply {
  background-blend-mode: multiply;
}

/* 屏幕 */
.screen {
  background-blend-mode: screen;
}

/* 叠加 */
.overlay {
  background-blend-mode: overlay;
}

/* 变暗 */
.darken {
  background-blend-mode: darken;
}

/* 变亮 */
.lighten {
  background-blend-mode: lighten;
}

/* 颜色减淡 */
.color-dodge {
  background-blend-mode: color-dodge;
}

/* 颜色加深 */
.color-burn {
  background-blend-mode: color-burn;
}

/* 强光 */
.hard-light {
  background-blend-mode: hard-light;
}

/* 柔光 */
.soft-light {
  background-blend-mode: soft-light;
}

/* 差异 */
.difference {
  background-blend-mode: difference;
}

/* 排除 */
.exclusion {
  background-blend-mode: exclusion;
}

/* 色相 */
.hue {
  background-blend-mode: hue;
}

/* 饱和度 */
.saturation {
  background-blend-mode: saturation;
}

/* 颜色 */
.color {
  background-blend-mode: color;
}

/* 亮度 */
.luminosity {
  background-blend-mode: luminosity;
}

高级用法

css
/* 容器 */
.container {
  background-blend-mode: normal;
}

/* 静态 */
.static {
  background-blend-mode: normal;
}

/* 相对 */
.relative {
  background-blend-mode: normal;
}

/* 绝对 */
.absolute {
  background-blend-mode: normal;
}

/* 固定 */
.fixed {
  background-blend-mode: normal;
}

/* 粘性 */
.sticky {
  background-blend-mode: normal;
}

/* 响应式布局 */
.responsive {
  background-blend-mode: normal;
}

/* 卡片布局 */
.card {
  background-blend-mode: normal;
}

/* 表单布局 */
.form {
  background-blend-mode: normal;
}

/* 图片画廊 */
.gallery {
  background-blend-mode: normal;
}

/* 混合单位 */
.mixed-units {
  background-blend-mode: normal;
}

/* 带命名的项目 */
.named-items {
  background-blend-mode: normal;
}

/* 悬停效果 */
.card {
  transition: background-blend-mode 0.3s ease-in-out;
}

.card:hover {
  background-blend-mode: multiply;
}

浏览器兼容性

浏览器版本
Chrome35+
Firefox30+
Safari8+
Edge79+
iOS Safari8+
Android Browser35+
Chrome for Android35+

注意事项

  • background-blend-mode 可以用于任何元素
  • background-blend-mode 定义元素背景的混合模式
  • normal 是默认值,表示正常

相关属性

相关资源