News Journal

For web developers

Backgrounds

The CSS background properties are used to add background effects for elements.

By Susana deOliveira

When you start to learn about the different properties and practice, you see a whole new world of possibilities for design, and creativity is activated.

CSS mix-blend-mode Property

Specifies how an element's content should blend with its direct parent background.

CSS blending modes determine how two layers visually interact. In the following example, I chose an image and a background as layers to change the image's appearance, give it a makeover, or create a dramatic color transformation, so that the background color is taken into account.

I've always used photo editing tools to give them a special touch, that's why I like this way of treating photos so much; they're like little works of art.

[You can find more information about the specifications through the link from the World Wide Web Consortium (W3C):Compositing and Blending Level 2]


Playing with mix-blend-mode

HELLO WORLD!

CSS background-blend-mode Property

Defines the blending mode of each background layer (color and/or image).

While the "mix-blend" mode blends the content of an element with its background, the "background-blend" mode blends multiple backgrounds (colors and images) of the same element. Therefore, it's best to use "mix-blend" mode to blend a text element with the background of its parent element or one image over another, and to use "background-blend" mode when you have more than one background layer for an element and want them to blend together.

All elements have the same CSS linear-gradient Function, with the same color stops, as the value for the background-image property; which represents the color transition that goes in a straight line. And, I added a fourth element with the value text for the background-clip property, just to compare another way of styling text.

  • This element has multiple backgrounds.

  • Here, the backgrounds are blended.

  • The color text and border are blended.

  • The background clipped to the foreground text.

Forever is composed of nows.

__Emily Dickinson