...

/

Sizing Backgrounds Using Keywords

Sizing Backgrounds Using Keywords

There are two keywords for sizing backgrounds. "contain" and "cover". Let's see how they work.

We'll cover the following...

In one of the first examples in this section, we used a large background image within a smaller element.

The result was that the image got cut off. What if we didn’t want this behavior​?

Here’s the example again.

This time we’ll size the background image using these keywords. Like this:

 ...