I'm looking to update the look of a website by changing the background color to a picture. The CSS code I am using is as follows:
.bg {
opacity: 5;
background-repeat: no-repeat;
background-size: cover;
background-position: 50% 100%;
background-image: url('../../assets/pics/bg.jpg');
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100%;
height: 100%;
z-index: 5;
}
When I add <body class="bg">
to the HTML file, the website displays as white. However, if I include an image with
<img id="logo" src="path to img">
, it works fine. I prefer using CSS for this because it's more efficient. The image path in the CSS file is:
../../assets/pics/bg.jpg
There are no errors shown in Chrome Developer Tools. Can someone assist me with this issue?
(For reference, I am working on editing the page "mcggehrden.de/idesk/v3" and aiming to set a custom background.)