sarina28 Posted February 28, 2010 Report Share Posted February 28, 2010 I'm trying to learn how to randomize a background image on one of my websites, but I have the image link in my external style sheet like this: #branding{ display:block; position:absolute; background-image:url(/body/header.png); background-repeat: no-repeat; height:483px; width:960px; margin-bottom:-7px; } I figured out how to randomize images on the html page itself like this: It works great, and I want to be able to do the same with the bg img in the style sheet. I read it could be done, but I can't figure it out. Thanks for the help Quote Link to comment Share on other sites More sharing options...
administrator Posted February 28, 2010 Report Share Posted February 28, 2010 Just use php to override the #branding css rules right in the page. That is the easiest way. Another thing you could do, is use php to generate the css file on the fly .. that is more involved thought. You could also do this with DOM scripting. Stefan Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.