Welcome to the world of HTML
Check out this simple CSS code snippet:
.box{
width:500px;
height:500px;
background: #eb01a5;/* fallback */
background-image:url("https://images.pexels.com/photos/3370704/pexels-photo-3370704.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500"); /* fallback */
background-image:
linear-gradient(rgba(255, 0, 0, 0), rgba(217, 19, 93, 0.73)),
url('https://images.pexels.com/photos/3224164/pexels-photo-3224164.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500');
}
Understanding linear-gradients: The first value determines the starting color while the second value indicates the ending color.
For example:
background-image: linear-gradient(red, yellow), url(image_url);
If both values are the same, you get a solid color effect.
Important note: Keep in mind that some browsers may not fully support background image linear gradients, so it's wise to include a fallback background color and image.