Transparent Background Image with a Gradient

前端 未结 6 1895
庸人自扰
庸人自扰 2020-12-08 07:07

Today I was designing a transparent PNG background that would only sit in the top left of a div, and the rest of the div would maintain a gradient background for all transpa

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-08 07:46

    You can use Transparency and gradients. Gradients support transparency. You can use this, for example, when stacking multiple backgrounds, to create fading effects on background images.

    background: linear-gradient(to right, rgba(255,255,255,0) 20%,
                  rgba(255,255,255,1)), url(http://foo.com/image.jpg);
    

提交回复
热议问题