Interactive online courses HTML Academy
2026-03-09 12:56 Diff

You can assign several background images to a block at the same time. To do this, the paths to the images in the background-image or background properties are separated by commas:

background-image: url("image-1.png"), url("image-2.png");

In this case, the images that are listed first will be displayed higher: so image-1.png in the example will be higher than image-2.png.

The values of other properties for multiple background images are also comma-separated. The order of the values must match the order of the background images. For example:

/* For the first image the scaling is "contain," and for the second it is 100px */ background-size: contain, 100px; /* For the first image the positioning is top, and for the second it is 100% */ background-position: top, 100%;

Let’s give Muffin some trendy glasses in the portrait using a second background image.