高于“100%"的 CSS background-size 属性是什么意思? [英] CSS background-size property above `100%` means?

查看:30
本文介绍了高于“100%"的 CSS background-size 属性是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做渐变动画并应用

I'm doing gradient animation and I apply

background-size: 100% 100%; 但它不起作用.

然后我尝试了 background-size: 600% 600%; 现在它工作正常.

then I tried background-size: 600% 600%; now its working fine.

以像素为单位,高达 100% 我理解.但高于 100% 我没有得到谁能向我解释一下这是什么意思:600% 600%? 它是如何计算的?

In pixel and up to 100% I understood. but above 100% I'm not getting Can anyone explain to me what is this means : 600% 600%? how it is calculating?

推荐答案

当你以百分比给出高度和宽度时

When you give height and width in percentage

它将相应尺寸的图像拉伸到背景定位区域的指定百分比.背景定位区域由background-origin的值决定(默认为padding box).但是,如果背景的 background-attachment 值是固定的,则定位区域是整个视口.不允许使用负值.

It Stretches the image in the corresponding dimension to the specified percentage of the background positioning area. The background positioning area is determined by the value of background-origin (by default, the padding box). However, if the background's background-attachment value is fixed, the positioning area is instead the entire viewport. Negative values are not allowed.

这些是一些给你简要解释的好文章

These are some of the good articles which give you explanation in brief

https://developer.mozilla.org/en-US/docs/Web/CSS/background-size

https://www.w3.org/TR/css-backgrounds-3/#the-background-size

这是一个渐变

https://drafts.c​​sswg.org/css-images-3/#gradients

这篇关于高于“100%"的 CSS background-size 属性是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆