html - 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.
解决方案
你的意思是这样的吗?
适用于所有主要浏览器 - 在 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%;
}
推荐阅读
- excel - COUNTIFS formula - unique values
- regex - 正则表达式 - 从起点到终点抓取单词
- android - OSM 奖励包 - OSRMRoadManager::getRoad: 请求失败
- javascript - Web 应用程序如何将浏览器带到前台?
- javascript - 防止长按选择附近的文本
- markdown - Pandoc:如何在将 md 渲染为 pdf 时保持图像和字幕的顺序
- javascript - 使用 JavaScript 进行 api 发布请求后如何在 Laravel 中闪烁消息?
- sql - 在 SQL 中加入 2 个不重复的表
- google-sheets - 有人可以告诉我为什么谷歌表格上的这种条件格式没有突出显示 J8/9
- python - 协程和异步/等待