1 reply [Last post]
mrgrammar
mrgrammar's picture
Offline
newbie
Last seen: 6 years 13 weeks ago
Timezone: GMT-4
Joined: 2015-04-29
Posts: 1
Points: 2

I've been playing with the background properties and specifically size. One question that I can't find the answer to:

When background size is set to cover, what determines how large the image scales up to?

By definition, when the size is set to "cover":
"Scale the background image to be as large as possible so that the background area is completely covered by the background image. Some parts of the background image may not be in view within the background positioning area."

So the image scales to cover the background area. What constitutes the "background area?" Is that the user's screen, the body width, row width, column width, or something else?

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 21 weeks 3 days ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9776
Points: 3858

From the css specs

Quote:

cover’
Scale the image, while preserving its intrinsic aspect ratio (if any), to the smallest size such that both its width and its height can completely cover the background positioning area.

See CSS Backgrounds and Borders Module Level 3.

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.