首页 > 解决方案 > How to add background-color on background-image?

问题描述

Css here...

background-image: url("image/login-background-image.png");
background-repeat: no-repeat;
background-size: cover;

I want background-color up-side of background-image.

标签: htmlcss

解决方案


你的意思是这样的吗?

适用于所有主要浏览器 - 在 chrome 上测试,即 firefox 和 edge。

body {
background-image: 
  linear-gradient(rgba(46, 49, 65, 0.8), rgba(46, 49, 65, 0.8)),     
  url("https://images.freeimages.com/images/large-previews/647/snowy-mountain-1378865.jpg");
width:100%;
height:100%;
}


推荐阅读