문제

sorry if the title isn't overly clear but i don't know how else to word it.

I have two websites and I will be looking after another one while the other wont be touched after it is released. What I want to do is get the sites background to change when the other site's background that I will be maintaining changes.

Is this possible?

Thanks

도움이 되었습니까?

해결책

Yes, just set the background-image url to the full path of the background image on the site that will be changing, then just make sure that any time you change the background image, you keep the filename the same and overwrite the previous background.

Set this code on the site that will be changing:

body {
background :url('/images/bg.jpg');
}

And this code on the site that won't be changing(change the URL to the absolute path of the background image from the dynamic site):

body {
background: url('http://yoursite.com/images/bg.jpg');
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top