- This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
Viewing 7 posts - 1 through 7 (of 7 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Hi there
I have a website that needs a different background to display every time a user reloads the page. How can I do this in CSS?
ALSO
How can I make sure that background is centered in the middle of the page (vertically and horizontally), and if the user has a larger screen, it will be white around the image.
THANKS!
The rotation can be accomplished with some fairly basic PHP. I haven’t tried the following method, but it looks like a nice choice:
http://sonspring.com/journal/easy-random-css-backgrounds
Centering the background:
body {
background: url(path/to/image.jpg) top center no-repeat;
}
Awesome! Thank you so much!
Oh, and to make sure white will be the color that goes around it, do this:
body {
background: url(path/to/image.jpg) top center no-repeat #fff;
}
Ok, now I’m having a problem
Check out this page This Page
User:user
Pass:user
On my computer, and another computer, I have to reload the page a few times just to make the background image pop up. Do you know why this is hapenning?
Ok, So what you guys are saying is that I need more images to be in the folder, and that I need to add code making sure that the browser deletes cookies when visitng the page.
How do I make that code? I have no clue what to do in PHP, I only every use CSS and Html
Awesome!
Thanks!