Wratox1
Member
- Reaction score
- 22
Hello, how can i change the backgroundimage of a div, without changing the divs size, and if the image is smaller/bigger than the div it will be centered i the div?
its for a gallery, im using miniature pictures and when you click on one a divs background changes, and this is done with javascript(onclick).
the problem i have is that if the image is to small or big, it will repeat itself or not show the whole picture, even if i have
in my css assigned to the div..
how can i avoid this problem?
its for a gallery, im using miniature pictures and when you click on one a divs background changes, and this is done with javascript(onclick).
the problem i have is that if the image is to small or big, it will repeat itself or not show the whole picture, even if i have
Code:
background-repeat: no-repeat; background-position: center center ;
how can i avoid this problem?