Terry Gilliver
Posts: 0
Joined: Fri Apr 18, 2014 8:45 pm

background image

I have added a background image to my page using the following css:

pre
.wallpaper {
background-image: url("../img/bg.png");
background-repeat: no-repeat;
background-size: cover;
}
/pre

The resultant background has a white bar on the left which I cannot account for. It is definitely not in the original image:

Image

Terry Gilliver
Posts: 0
Joined: Fri Apr 18, 2014 8:45 pm

background image

Sorted.

Adding background-position: center; fixed the problem.

Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

background image

thanks for updating the topic... I was looking for the same solution Terry :-)

Terry Gilliver
Posts: 0
Joined: Fri Apr 18, 2014 8:45 pm

background image

I did find on examination of my image in fireworks, that it had a transparent bar down each side, which accounted for the 'white' bar on the left. just something to look out for as most image viewers won't show this as transparencies will allow the background to "show through".

Return to “Issues”