REMINDER: It's crucial to note that I am only able to edit the CSS, not the base HTML. This is specifically for a custom Reddit stylesheet.
I am looking to create a subtle color overlay on top of an image background as a tint effect. Here are some methods I have attempted:
background: url(image) no-repeat, rgba(0,0,0,0.5);
Result: Only displays the image without the desired overlay effect.
background: rgba(0,0,0,0.5), url(image) no-repeat;
Result: Shows the image but distorts its scaling.
background-image: url(image) no-repeat;
background: rgba(0,0,0,0.5);
Result: Creates a solid black background with transparency instead of overlaying the image.
background-image: url(image) no-repeat;
background-color: rgba(0,0,0,0.5);
Result: Displays just the image without affecting scaling.
background: url(image) no-repeat;
background-color: rgba(0,0,0,0.5);
Result: Successfully shows the image without breaking scaling.
I also attempted to implement @Trevan's solution, but it did not yield the desired outcome:
#header:lang(dd) {
position: relative;
background: url(%%HexBackground%%) no-repeat;
}
#header:lang(dd)::before {
position: absolute;
content: "";
top: 0;
left: 0;
background: rgba(0,0,0,0.5);
}
It seems like my approach may be incorrect. Any suggestions would be greatly appreciated!